[gjs: 3/8] object, private: use automatic type conversion on pspec



commit b494ad5aa236ae16e49df8a201d9bdd3951321f8
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Tue Oct 9 05:52:42 2018 +0200

    object, private: use automatic type conversion on pspec

 gi/object.cpp  | 4 ++--
 gi/private.cpp | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gi/object.cpp b/gi/object.cpp
index 93fa06cf..d855d1c8 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -279,7 +279,7 @@ GParamSpec* ObjectPrototype::find_param_spec_from_id(JSContext* cx,
     /* First check for the ID in the cache */
     auto entry = m_property_cache.lookupForAdd(key);
     if (entry)
-        return entry->value().get();
+        return entry->value();
 
     GjsAutoJSChar js_prop_name;
     if (!gjs_string_to_utf8(cx, JS::StringValue(key), &js_prop_name))
@@ -299,7 +299,7 @@ GParamSpec* ObjectPrototype::find_param_spec_from_id(JSContext* cx,
 
     if (!m_property_cache.add(entry, key, std::move(param_spec)))
         g_error("Out of memory adding param spec to cache");
-    return entry->value().get();  /* owned by property cache */
+    return pspec; /* owned by property cache */
 }
 
 /* Gets the ObjectPrototype corresponding to obj.prototype. Cannot return null,
diff --git a/gi/private.cpp b/gi/private.cpp
index f8072182..512530e4 100644
--- a/gi/private.cpp
+++ b/gi/private.cpp
@@ -79,7 +79,7 @@ static bool gjs_override_property(JSContext* cx, unsigned argc, JS::Value* vp) {
     g_param_spec_set_qdata(new_pspec, ObjectBase::custom_property_quark(),
                            GINT_TO_POINTER(1));
 
-    args.rval().setObject(*gjs_param_from_g_param(cx, new_pspec.get()));
+    args.rval().setObject(*gjs_param_from_g_param(cx, new_pspec));
 
     return true;
 }


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