[gjs/wip/ptomato/mozjs31: 3/17] object: Root misc functions



commit b611d14bf60022003db9770b64a1f72c3140b8da
Author: Philip Chimento <philip endlessm com>
Date:   Wed Nov 2 16:19:25 2016 -0700

    object: Root misc functions
    
    This converts everything else in object.cpp to use exact rooting, that
    would otherwise have caused a compile error in mozjs31.

 gi/object.cpp |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/gi/object.cpp b/gi/object.cpp
index 91cdb07..3ab839a 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -1065,10 +1065,8 @@ wrapped_gobj_toggle_notify(gpointer      data,
                         G_OBJECT_TYPE_NAME(gobj));
             }
             if (is_sweeping) {
-                JSObject *object;
-
-                object = peek_js_obj(gobj);
-                if (JS_IsAboutToBeFinalized(&object)) {
+                JS::RootedObject object(js_context, peek_js_obj(gobj));
+                if (JS_IsAboutToBeFinalized(object.address())) {
                     /* Ouch, the JS object is dead already. Disassociate the GObject
                      * and hope the GObject dies too.
                      */


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