mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-23 00:51:51 +00:00
Don't force garbage collection on shutdown.
Doing so causes crashes on Windows and isn't needed anymore anyways, since we have started tracking weak references meanwhile.
This commit is contained in:
parent
4e0b500de0
commit
449d66ca01
14
v8js.cc
14
v8js.cc
@ -677,20 +677,6 @@ static void php_v8js_free_storage(void *object TSRMLS_DC) /* {{{ */
|
|||||||
}
|
}
|
||||||
c->context.~Persistent();
|
c->context.~Persistent();
|
||||||
|
|
||||||
/* Force garbage collection on our isolate, this is needed that V8 triggers
|
|
||||||
* our MakeWeak callbacks. Without these we won't remove our references
|
|
||||||
* on the PHP objects leading to memory leaks in PHP context.
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
v8::Locker locker(c->isolate);
|
|
||||||
v8::Isolate::Scope isolate_scope(c->isolate);
|
|
||||||
#if PHP_V8_API_VERSION < 3028036
|
|
||||||
while(!v8::V8::IdleNotification()) {};
|
|
||||||
#else
|
|
||||||
while(!c->isolate->IdleNotification(500)) {};
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Dispose yet undisposed weak refs */
|
/* Dispose yet undisposed weak refs */
|
||||||
for (std::map<zval *, v8js_persistent_obj_t>::iterator it = c->weak_objects.begin();
|
for (std::map<zval *, v8js_persistent_obj_t>::iterator it = c->weak_objects.begin();
|
||||||
it != c->weak_objects.end(); ++it) {
|
it != c->weak_objects.end(); ++it) {
|
||||||
|
Loading…
Reference in New Issue
Block a user