mirror of
https://github.com/phpv8/v8js.git
synced 2025-01-03 14:31:53 +00:00
exit v8::HandleScope and v8::IsolateScope before bailing out
This fixes some memory leaks.
This commit is contained in:
parent
2d9c831eeb
commit
a520f49335
16
v8js_v8.cc
16
v8js_v8.cc
@ -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) /* {{{ */
|
||||
|
Loading…
Reference in New Issue
Block a user