Index: src/platform-win32.cc |
diff --git a/src/platform-win32.cc b/src/platform-win32.cc |
index 4ea4f929bf781d0dd2fcfc823bf48c0aa3200138..65d31a94f9174c23e72ad0a26e199ef0deda29e2 100644 |
--- a/src/platform-win32.cc |
+++ b/src/platform-win32.cc |
@@ -2038,9 +2038,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; |
@@ -2060,6 +2059,7 @@ class SamplerThread : public Thread { |
sampler->SampleStack(sample); |
sampler->Tick(sample); |
} |
+ CpuProfiler::FinishTickSampleEvent(sampler->isolate()); |
ResumeThread(profiled_thread); |
} |