Index: src/platform-macos.cc |
diff --git a/src/platform-macos.cc b/src/platform-macos.cc |
index 1b76a18fd7fcd34ae662e963c3c9e2128a546707..041ccf370a47cacfb5be79f3e267541a881aeaef 100644 |
--- a/src/platform-macos.cc |
+++ b/src/platform-macos.cc |
@@ -809,9 +809,8 @@ class SamplerThread : public Thread { |
void SampleContext(Sampler* sampler) { |
thread_act_t profiled_thread = sampler->platform_data()->profiled_thread(); |
- TickSample sample_obj; |
- TickSample* sample = CpuProfiler::TickSampleEvent(sampler->isolate()); |
- if (sample == NULL) sample = &sample_obj; |
+ TickSample* sample = CpuProfiler::StartTickSampleEvent(sampler->isolate()); |
+ if (sample == NULL) return; |
if (KERN_SUCCESS != thread_suspend(profiled_thread)) return; |
@@ -848,6 +847,7 @@ class SamplerThread : public Thread { |
sampler->SampleStack(sample); |
sampler->Tick(sample); |
} |
+ CpuProfiler::FinishTickSampleEvent(sampler->isolate()); |
thread_resume(profiled_thread); |
} |