Index: src/platform-win32.cc |
diff --git a/src/platform-win32.cc b/src/platform-win32.cc |
index 7a354f3d13ca775aa97e9985fbe897c88ef38f15..2661e7255edbd83c0dd626c18700f5b25af5d169 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); |
} |