[gjs] Do not call priv_from_js from the GObject tracer



commit 54d60c278a39ce681b35d172b675a4b2d4449b65
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Jun 26 19:31:57 2012 +0200

    Do not call priv_from_js from the GObject tracer
    
    priv_from_js calls JS_BeginRequest when it refers to a dynamic JSClass
    (such as that used by GObjects), and that causes a deadlock when
    called from the GC thread
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678908

 gi/object.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gi/object.c b/gi/object.c
index fead7cd..9942ee2 100644
--- a/gi/object.c
+++ b/gi/object.c
@@ -1044,7 +1044,11 @@ object_instance_trace(JSTracer *tracer,
     ObjectInstance *priv;
     GList *iter;
 
-    priv = priv_from_js(tracer->context, obj);
+    /* DO NOT use priv_from_js here: that uses JS_BeginRequest,
+       but this is called from the GC thread, and deadlocks
+       We know we're of the right JSClass anyway.
+    */
+    priv = JS_GetPrivate(tracer->context, obj);
 
     for (iter = priv->signals; iter; iter = iter->next) {
         ConnectData *cd = iter->data;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]