From 01d4cdbb02775df9dca92c98d96abd3c107b7713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Thu, 6 Nov 2014 13:21:46 +0100 Subject: [PATCH] clean up poll handle data in close() function so that assert() won't fail --- platform/default/http_request_baton_curl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/default/http_request_baton_curl.cpp b/platform/default/http_request_baton_curl.cpp index ecde8618f..b8b4bac5f 100644 --- a/platform/default/http_request_baton_curl.cpp +++ b/platform/default/http_request_baton_curl.cpp @@ -134,6 +134,8 @@ public: } void stop() { + assert(poll_handle.data); + poll_handle.data = nullptr; uv_poll_stop(&poll_handle); uv_close((uv_handle_t *)&poll_handle, [](uv_handle_t *handle) { delete (Socket *)handle->data; @@ -141,7 +143,7 @@ public: } private: - // Make the destructor private to ensure that ew can only close the Socket + // Make the destructor private to ensure that we can only close the Socket // with stop(), and disallow manual deletion. ~Socket() { assert(!poll_handle.data);