Skip to content

Commit 561faff

Browse files
committed
fix(profiling) segfault on close
1 parent 0812b24 commit 561faff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/profiling-node/bindings/cpu_profiler.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ class MeasurementsTicker {
113113

114114
void Cleanup() {
115115
uv_timer_stop(&timer);
116-
uv_close(reinterpret_cast<uv_handle_t *>(&timer), nullptr);
116+
117+
auto handle = reinterpret_cast<uv_handle_t *>(&timer);
118+
119+
if(!uv_is_closing(handle)) {
120+
uv_close(handle, free_timer_callback);
121+
}
117122
}
118123
};
119124

0 commit comments

Comments
 (0)