Permalink
Browse files

ev_unref() when num_handles_ reaches zero.

  • Loading branch information...
1 parent 99b586d commit 4803bf31532d5567f8285bb94a600b23058cc166 @bnoordhuis committed Jun 6, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 curl.cc
View
@@ -186,12 +186,14 @@ Handle<Value> MultiHandle::Add(EasyHandle& ch) {
}
Handle<Value> MultiHandle::Remove(EasyHandle& ch) {
+ assert(num_handles_ > 0);
+
const CURLMcode status = curl_multi_remove_handle(mh_, ch);
if (status != CURLM_OK) {
return CurlError(status);
}
- if (--num_handles_ == 1) {
+ if (--num_handles_ == 0) {
// stop the event loop
ev_unref();
}

0 comments on commit 4803bf3

Please sign in to comment.