File tree 2 files changed +7
-2
lines changed
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) {
72
72
if (state_ != kInitialized )
73
73
return ;
74
74
75
- CHECK_EQ (false , persistent ().IsEmpty ());
76
75
uv_close (handle_, OnClose);
77
76
state_ = kClosing ;
78
77
79
- if (!close_callback.IsEmpty () && close_callback->IsFunction ()) {
78
+ if (!close_callback.IsEmpty () && close_callback->IsFunction () &&
79
+ !persistent ().IsEmpty ()) {
80
80
object ()->Set (env ()->context (),
81
81
env ()->handle_onclose_symbol (),
82
82
close_callback).Check ();
Original file line number Diff line number Diff line change
1
+ // Flags: --expose-gc
1
2
'use strict' ;
2
3
3
4
const common = require ( '../common' ) ;
@@ -97,3 +98,7 @@ const {
97
98
}
98
99
spinAWhile ( ) ;
99
100
}
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