Skip to content

Instantly share code, notes, and snippets.

@bnoordhuis
Created November 11, 2013 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnoordhuis/6aa54408ea7e8969f839 to your computer and use it in GitHub Desktop.
Save bnoordhuis/6aa54408ea7e8969f839 to your computer and use it in GitHub Desktop.
Check for leaked handles.
diff --git a/src/node.cc b/src/node.cc
index 3cb6a22..8e47662 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -3247,6 +3247,7 @@ int Start(int argc, char** argv) {
Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
uv_run(env->event_loop(), UV_RUN_DEFAULT);
+ assert(handle_scope.NumberOfHandles() == 0); // Check for leaked handles.
EmitExit(env);
RunAtExit(env);
env->Dispose();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment