[gjs] object: Remove JS_NewContext usage in a finalizer
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] object: Remove JS_NewContext usage in a finalizer
- Date: Wed, 15 Jan 2014 16:52:30 +0000 (UTC)
commit 0389020a3ef5316ed39a7db2bd229e6c276910ce
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Jan 15 11:52:10 2014 -0500
object: Remove JS_NewContext usage in a finalizer
gi/object.cpp | 17 ++++-------------
1 files changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/gi/object.cpp b/gi/object.cpp
index 511b28b..76947d9 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -1365,19 +1365,10 @@ object_instance_finalize(JSFreeOp *fop,
gjs_debug_lifecycle(GJS_DEBUG_GOBJECT,
"Removing from keep alive");
- /* We're in a finalizer while the runtime is about to be
- * destroyed. This is not the safest time to be calling back
- * into jsapi, but we have to do this or the keep alive could
- * be finalized later and call gobj_no_longer_kept_alive_func.
- */
- {
- JSContext *context = JS_NewContext(fop->runtime(), 8192);
- gjs_keep_alive_remove_child(priv->keep_alive,
- gobj_no_longer_kept_alive_func,
- obj,
- priv);
- JS_DestroyContext(context);
- }
+ gjs_keep_alive_remove_child(priv->keep_alive,
+ gobj_no_longer_kept_alive_func,
+ obj,
+ priv);
}
if (priv->info) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]