File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -72,11 +72,11 @@ void HandleWrap::Close(Local<Value> close_callback) {
7272 if (state_ != kInitialized )
7373 return ;
7474
75- CHECK_EQ (false , persistent ().IsEmpty ());
7675 uv_close (handle_, OnClose);
7776 state_ = kClosing ;
7877
79- if (!close_callback.IsEmpty () && close_callback->IsFunction ()) {
78+ if (!close_callback.IsEmpty () && close_callback->IsFunction () &&
79+ !persistent ().IsEmpty ()) {
8080 object ()->Set (env ()->context (),
8181 env ()->handle_onclose_symbol (),
8282 close_callback).Check ();
Original file line number Diff line number Diff line change 1+ // Flags: --expose-gc
12'use strict' ;
23
34const common = require ( '../common' ) ;
@@ -97,3 +98,7 @@ const {
9798 }
9899 spinAWhile ( ) ;
99100}
101+
102+ // Make sure that the histogram instances can be garbage-collected without
103+ // and not just implictly destroyed when the Environment is torn down.
104+ process . on ( 'exit' , global . gc ) ;
You can’t perform that action at this time.
0 commit comments