0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-09-19 16:35:19 +00:00

exit v8::HandleScope and v8::IsolateScope before bailing out

This fixes some memory leaks.
This commit is contained in:
Stefan Siegl 2015-12-31 23:44:01 +01:00
parent 2d9c831eeb
commit a520f49335

View File

@ -82,6 +82,7 @@ void v8js_v8_call(v8js_ctx *c, zval **return_value,
{
char *tz = NULL;
{
V8JS_CTX_PROLOGUE(c);
V8JSG(timer_mutex).lock();
@ -139,12 +140,7 @@ void v8js_v8_call(v8js_ctx *c, zval **return_value,
efree(timer_ctx);
/* Check for fatal error marker possibly set by v8js_error_handler; just
* rethrow the error since we're now out of V8. */
if(V8JSG(fatal_error_abort)) {
zend_bailout();
}
if(!V8JSG(fatal_error_abort)) {
char exception_string[64];
if (c->time_limit_hit) {
@ -201,6 +197,14 @@ void v8js_v8_call(v8js_ctx *c, zval **return_value,
v8js_to_zval(result, *return_value, flags, c->isolate TSRMLS_CC);
}
}
} /* /V8JS_CTX_PROLOGUE */
if(V8JSG(fatal_error_abort)) {
/* Check for fatal error marker possibly set by v8js_error_handler; just
* rethrow the error since we're now out of V8. */
zend_bailout();
}
}
/* }}} */
void v8js_terminate_execution(v8::Isolate *isolate) /* {{{ */