Skip to content

Commit

Permalink
ref(profiling) Fix electron crash
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBa committed Nov 8, 2024
1 parent a91a5ba commit c82add5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/profiling-node/bindings/cpu_profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,8 @@ void SentryProfile::Start(Profiler *profiler) {

// Initialize the CPU Profiler
profiler->cpu_profiler->StartProfiling(
profile_title,
{v8::CpuProfilingMode::kCallerLineNumbers,
v8::CpuProfilingOptions::kNoSampleLimit, kSamplingInterval});
profile_title, v8::CpuProfilingMode::kCallerLineNumbers, true,
v8::CpuProfilingOptions::kNoSampleLimit);

// listen for memory sample ticks
profiler->measurements_ticker.add_cpu_listener(id, cpu_sampler_cb);
Expand Down Expand Up @@ -1169,6 +1168,7 @@ napi_value Init(napi_env env, napi_value exports) {
}

Profiler *profiler = new Profiler(env, isolate);
profiler->cpu_profiler->SetSamplingInterval(kSamplingInterval);

if (napi_set_instance_data(env, profiler, FreeAddonData, NULL) != napi_ok) {
napi_throw_error(env, nullptr, "Failed to set instance data for profiler.");
Expand Down

0 comments on commit c82add5

Please sign in to comment.