diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2010-11-15 15:01:23 -0500 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2010-12-01 11:46:13 -0500 |
commit | 1deced809e3f09f9b787dd07dfd7558dc46f7461 (patch) | |
tree | d746700c626c1302822818286a882804bee823d9 | |
parent | fd1b655863610832f65077bcf08a0c560b14d83b (diff) | |
download | gjs-1deced809e3f09f9b787dd07dfd7558dc46f7461.tar.gz |
Error more verbosely when we finalize a proxy for a dead object
Include information about the type of the affected object when
there was a reference counting error that resulted in a proxy
pointing to a GObject that has already been finalized.
-rw-r--r-- | gi/object.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gi/object.c b/gi/object.c index 882cfe94..ffa4fa6c 100644 --- a/gi/object.c +++ b/gi/object.c @@ -795,7 +795,11 @@ object_instance_finalize(JSContext *context, g_base_info_get_name ( (GIBaseInfo*) priv->info) )); if (priv->gobj) { - g_assert(priv->gobj->ref_count > 0); + if (G_UNLIKELY (priv->gobj->ref_count <= 0)) { + g_error("Finalizing proxy for an already freed object of type: %s.%s\n", + g_base_info_get_namespace((GIBaseInfo*) priv->info), + g_base_info_get_name((GIBaseInfo*) priv->info)); + } set_js_obj(context, priv->gobj, NULL); g_object_remove_toggle_ref(priv->gobj, wrapped_gobj_toggle_notify, JS_GetRuntime(context)); |