Index: src/platform-macos.cc |
diff --git a/src/platform-macos.cc b/src/platform-macos.cc |
index 704fe12619c8ce7cc51f4d8ce5bb793b21cd5a8a..a570868e51fab61671cc3e5c78126b35ec5153d8 100644 |
--- a/src/platform-macos.cc |
+++ b/src/platform-macos.cc |
@@ -819,9 +819,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; |
@@ -858,6 +857,7 @@ class SamplerThread : public Thread { |
sampler->SampleStack(sample); |
sampler->Tick(sample); |
} |
+ CpuProfiler::FinishTickSampleEvent(sampler->isolate()); |
thread_resume(profiled_thread); |
} |