[gjs] util: Add BeginRequest/EndRequest back to priv_from_js



commit 3937d5f24cca23f749700259797418305bef2e75
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Jan 2 17:55:48 2013 -0500

    util: Add BeginRequest/EndRequest back to priv_from_js
    
    Even though JS_GetInstancePrivate isn't documented as needing a
    request, it does.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691038

 gjs/jsapi-util.h |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gjs/jsapi-util.h b/gjs/jsapi-util.h
index e3c10c8..3c14c5c 100644
--- a/gjs/jsapi-util.h
+++ b/gjs/jsapi-util.h
@@ -75,11 +75,15 @@ typedef struct GjsRootedArray GjsRootedArray;
     {                                                                   \
         return gjs_typecheck_instance(context, object, &class, throw);  \
     }                                                                   \
-    static inline type*                                                 \
+    static inline type *                                                \
     priv_from_js(JSContext *context,                                    \
                  JSObject  *object)                                     \
     {                                                                   \
-        return JS_GetInstancePrivate(context, object, &class, NULL);    \
+        type *priv;                                                     \
+        JS_BeginRequest(context);                                       \
+        priv = JS_GetInstancePrivate(context, object, &class, NULL);    \
+        JS_EndRequest(context);                                         \
+        return priv;                                                    \
     }                                                                   \
     __attribute__((unused)) static JSBool                               \
     priv_from_js_with_typecheck(JSContext *context,                     \



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