diff --git a/spec/mem/blunt_spec.rb b/spec/mem/blunt_spec.rb index c27a5e9..81a5696 100644 --- a/spec/mem/blunt_spec.rb +++ b/spec/mem/blunt_spec.rb @@ -24,12 +24,14 @@ describe "A Very blunt test to make sure that we aren't doing stupid leaks" do end it "can eval simple value passing statements repeatedly without significantly increasing memory" do - cxt = V8::Context.new - 500.times do - cxt.eval('7 * 6') - run_v8_gc + V8::C::Locker() do + cxt = V8::Context.new + 500.times do + cxt.eval('7 * 6') + run_v8_gc + end end - process_memory.should <= @start_memory * 1.1 + process_memory.should <= @start_memory * 1.1 end def process_memory