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 ed3d79d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/profiling-node/bindings/cpu_profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,10 @@ void SentryProfile::Start(Profiler *profiler) {
started_at = uv_hrtime();
timestamp = timestamp_milliseconds();

// Initialize the CPU Profiler
profiler->cpu_profiler->StartProfiling(
profile_title,
{v8::CpuProfilingMode::kCallerLineNumbers,
v8::CpuProfilingOptions::kNoSampleLimit, kSamplingInterval});
// Initialize the CPU Profiler
profiler->cpu_profiler
->StartProfiling(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 ed3d79d

Please sign in to comment.