Skip to content

Commit

Permalink
fix(profiling) segfault on close
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBa committed Sep 10, 2024
1 parent 0812b24 commit 561faff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/profiling-node/bindings/cpu_profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ class MeasurementsTicker {

void Cleanup() {
uv_timer_stop(&timer);
uv_close(reinterpret_cast<uv_handle_t *>(&timer), nullptr);

auto handle = reinterpret_cast<uv_handle_t *>(&timer);

if(!uv_is_closing(handle)) {
uv_close(handle, free_timer_callback);
}
}
};

Expand Down

0 comments on commit 561faff

Please sign in to comment.