| Index: runtime/vm/compiler_test.cc
|
| diff --git a/runtime/vm/compiler_test.cc b/runtime/vm/compiler_test.cc
|
| index 5225c53a9cc2fb7a42e752d40f12075fe0d3005c..6e44b6c4a2c06415b117692b69e3e4e1de99bd60 100644
|
| --- a/runtime/vm/compiler_test.cc
|
| +++ b/runtime/vm/compiler_test.cc
|
| @@ -102,10 +102,13 @@ VM_TEST_CASE(CompileFunctionOnHelperThread) {
|
| ASSERT(isolate->background_compiler() != NULL);
|
| isolate->background_compiler()->CompileOptimized(func);
|
| Monitor* m = new Monitor();
|
| - MonitorLocker ml(m);
|
| - while (!func.HasOptimizedCode()) {
|
| - ml.WaitWithSafepointCheck(thread, 1);
|
| + {
|
| + MonitorLocker ml(m);
|
| + while (!func.HasOptimizedCode()) {
|
| + ml.WaitWithSafepointCheck(thread, 1);
|
| + }
|
| }
|
| + delete m;
|
| BackgroundCompiler::Stop(isolate);
|
| }
|
|
|
|
|