Skip to content

Commit

Permalink
Check poll handle is active before attempting to stop and unreference it
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Dana committed Feb 25, 2016
1 parent 8c9c552 commit ce00a23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion socket_watcher.cpp
Expand Up @@ -84,7 +84,7 @@ void SocketWatcher::Stop(const Nan::FunctionCallbackInfo<Value>& info)
}

void SocketWatcher::StopInternal() {
if (poll_ != NULL) {
if (poll_ != NULL && uv_is_active((uv_handle_t*)poll_)) {
uv_poll_stop(poll_);
Unref();
}
Expand Down

0 comments on commit ce00a23

Please sign in to comment.