make sure that the async handle always gets closed
This commit is contained in:
@@ -22,7 +22,6 @@ class Request : private util::noncopyable {
|
||||
public:
|
||||
using Callback = std::function<void(const Response &)>;
|
||||
Request(const Resource &resource, uv_loop_t *loop, Callback callback);
|
||||
~Request();
|
||||
|
||||
public:
|
||||
// May be called from any thread.
|
||||
@@ -33,6 +32,8 @@ public:
|
||||
void cancel();
|
||||
|
||||
private:
|
||||
~Request();
|
||||
void invoke();
|
||||
static void notifyCallback(uv_async_t *async);
|
||||
static void cancelCallback(uv_async_t *async);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user