From a951b82a40358d6a718dc5bf7a1bc352f3463c2d Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Mon, 10 Jun 2013 16:28:37 +0200 Subject: [PATCH] Use persistent context + Dispose --- v8js.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/v8js.cc b/v8js.cc index c7793c0..f4eb533 100644 --- a/v8js.cc +++ b/v8js.cc @@ -231,10 +231,15 @@ static HashTable *php_v8js_v8_get_properties(zval *object TSRMLS_DC) /* {{{ */ v8::Locker locker(obj->isolate); v8::Isolate::Scope isolate_scope(obj->isolate); v8::HandleScope local_scope(obj->isolate); + v8::Persistent temp_context = v8::Context::New(); + v8::Context::Scope temp_scope(temp_context); if (php_v8js_v8_get_properties_hash(obj->v8obj, retval, obj->flags, obj->isolate TSRMLS_CC) == SUCCESS) { + temp_context.Dispose(); return retval; } + + temp_context.Dispose(); return NULL; } /* }}} */