summaryrefslogtreecommitdiff
path: root/gi/object.c
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2012-02-08 16:19:16 -0500
committerJasper St. Pierre <jstpierre@mecheye.net>2012-02-10 10:22:04 -0500
commitabeb99b8930dfa24322d77d3bfc815213b3ae76c (patch)
treed2d84922a835f442c8363eeb05a60d5000e290a2 /gi/object.c
parent6e179e9e10f43d61cfc237757a91fe1164239c20 (diff)
downloadgjs-abeb99b8930dfa24322d77d3bfc815213b3ae76c.tar.gz
object: Make sure that we properly add a ref to custom objects
Since we initialize custom GObjects through construct properties, we need to make sure that we don't get fooled and think that g_object_newv returned a singleton. https://bugzilla.gnome.org/show_bug.cgi?id=669709
Diffstat (limited to 'gi/object.c')
-rw-r--r--gi/object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gi/object.c b/gi/object.c
index 94185f6b..2c4bad66 100644
--- a/gi/object.c
+++ b/gi/object.c
@@ -934,7 +934,7 @@ object_instance_init (JSContext *context,
free_g_params(params, n_params);
old_jsobj = peek_js_obj(context, gobj);
- if (old_jsobj != NULL) {
+ if (old_jsobj != NULL && old_jsobj != *object) {
/* g_object_newv returned an object that's already tracked by a JS
* object. Let's assume this is a singleton like IBus.IBus and return
* the existing JS wrapper object.