Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
unix, windows: set active flag on unref'd handles
A logic bug in uv__handle_start() and uv__handle_stop() stopped the active flag
from getting set (or unset) on unref'd handles.
  • Loading branch information
bnoordhuis committed May 27, 2012
1 parent 028fef8 commit 2ec0986
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/uv-common.h
Expand Up @@ -155,16 +155,14 @@ UNUSED static int uv__is_active(const uv_handle_t* h) {

UNUSED static void uv__handle_start(uv_handle_t* h) {
if (h->flags & UV__ACTIVE) return;
if (!(h->flags & UV__REF)) return;
if (h->flags & UV__REF) uv__active_handle_add(h);
h->flags |= UV__ACTIVE;
uv__active_handle_add(h);
}
#define uv__handle_start(h) uv__handle_start((uv_handle_t*)(h))

UNUSED static void uv__handle_stop(uv_handle_t* h) {
if (!(h->flags & UV__ACTIVE)) return;
if (!(h->flags & UV__REF)) return;
uv__active_handle_rm(h);
if (h->flags & UV__REF) uv__active_handle_rm(h);
h->flags &= ~UV__ACTIVE;
}
#define uv__handle_stop(h) uv__handle_stop((uv_handle_t*)(h))
Expand Down

0 comments on commit 2ec0986

Please sign in to comment.