From ce00a232ae1922a1081639cf20c1f763915459d6 Mon Sep 17 00:00:00 2001 From: Jason Dana Date: Thu, 25 Feb 2016 11:44:35 -0500 Subject: [PATCH] Check poll handle is active before attempting to stop and unreference it --- socket_watcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/socket_watcher.cpp b/socket_watcher.cpp index e64e095..89fd400 100644 --- a/socket_watcher.cpp +++ b/socket_watcher.cpp @@ -84,7 +84,7 @@ void SocketWatcher::Stop(const Nan::FunctionCallbackInfo& info) } void SocketWatcher::StopInternal() { - if (poll_ != NULL) { + if (poll_ != NULL && uv_is_active((uv_handle_t*)poll_)) { uv_poll_stop(poll_); Unref(); }