Skip to content

Commit

Permalink
Merge pull request #12 from jasondana/check-unref
Browse files Browse the repository at this point in the history
Check poll handle is active before attempting to stop and unreference it
  • Loading branch information
btrask committed Mar 2, 2016
2 parents 8c9c552 + ce00a23 commit 1c181db
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 1c181db

Please sign in to comment.