Index: src/platform-macos.cc |
diff --git a/src/platform-macos.cc b/src/platform-macos.cc |
index afcd80affff3812b0622e6735c118b2a811e1870..a937ed3a5c12c580a2c26e36611e6070aa2ee2dc 100644 |
--- a/src/platform-macos.cc |
+++ b/src/platform-macos.cc |
@@ -743,11 +743,8 @@ class SamplerThread : public Thread { |
: Thread(Thread::Options("SamplerThread", kSamplerThreadStackSize)), |
interval_(interval) {} |
- static void SetUp() { |
- if (!mutex_) { |
- mutex_ = OS::CreateMutex(); |
- } |
- } |
+ static void SetUp() { if (!mutex_) mutex_ = OS::CreateMutex(); } |
+ static void TearDown() { delete mutex_; } |
static void AddActiveSampler(Sampler* sampler) { |
ScopedLock lock(mutex_); |
@@ -881,6 +878,12 @@ void OS::SetUp() { |
} |
+void OS::TearDown() { |
+ SamplerThread::TearDown(); |
+ delete limit_mutex; |
+} |
+ |
+ |
Sampler::Sampler(Isolate* isolate, int interval) |
: isolate_(isolate), |
interval_(interval), |