Skip to content

Commit 154c42e

Browse files
committed
ref(profiling) Fix electron crash
1 parent a91a5ba commit 154c42e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/profiling-node/bindings/cpu_profiler.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,12 @@ void SentryProfile::Start(Profiler *profiler) {
331331
started_at = uv_hrtime();
332332
timestamp = timestamp_milliseconds();
333333

334+
v8::CpuProfilingOptions options = v8::CpuProfilingOptions(
335+
v8::CpuProfilingMode::kCallerLineNumbers,
336+
v8::CpuProfilingOptions::kNoSampleLimit, kSamplingInterval);
337+
334338
// Initialize the CPU Profiler
335-
profiler->cpu_profiler->StartProfiling(
336-
profile_title,
337-
{v8::CpuProfilingMode::kCallerLineNumbers,
338-
v8::CpuProfilingOptions::kNoSampleLimit, kSamplingInterval});
339+
profiler->cpu_profiler->StartProfiling(profile_title, &options);
339340

340341
// listen for memory sample ticks
341342
profiler->measurements_ticker.add_cpu_listener(id, cpu_sampler_cb);

0 commit comments

Comments
 (0)