Index: src/platform-cygwin.cc |
diff --git a/src/platform-cygwin.cc b/src/platform-cygwin.cc |
index 702b1d2115bf05920822fac212f49d9981f7d99c..b39dfc0eef8aa6132fee8de5ab519d03dcabcb98 100644 |
--- a/src/platform-cygwin.cc |
+++ b/src/platform-cygwin.cc |
@@ -692,9 +692,8 @@ class SamplerThread : public Thread { |
CONTEXT context; |
memset(&context, 0, sizeof(context)); |
- 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; |
static const DWORD kSuspendFailed = static_cast<DWORD>(-1); |
if (SuspendThread(profiled_thread) == kSuspendFailed) return; |
@@ -714,6 +713,7 @@ class SamplerThread : public Thread { |
sampler->SampleStack(sample); |
sampler->Tick(sample); |
} |
+ CpuProfiler::FinishTickSampleEvent(sampler->isolate()); |
ResumeThread(profiled_thread); |
} |