[gjs/gjs-1-30: 3/3] object: handle the case when constructing a proxy fails
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/gjs-1-30: 3/3] object: handle the case when constructing a proxy fails
- Date: Fri, 13 Jan 2012 21:34:38 +0000 (UTC)
commit 65a253dfafe755490a65f6339a9756d43292e630
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Fri Jan 13 10:25:27 2012 -0500
object: handle the case when constructing a proxy fails
If constructing the proxy object for a GObject fails (because
the code is called from with GC, perhaps), the code that unsets
unthreadsafe_template_for_constructor never ran, resulting in
a crash on the next attempt to construct a new object.
https://bugzilla.gnome.org/show_bug.cgi?id=661323
https://bugzilla.redhat.com/show_bug.cgi?id=725165
gi/object.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gi/object.c b/gi/object.c
index b8edb3c..9dc573f 100644
--- a/gi/object.c
+++ b/gi/object.c
@@ -1541,9 +1541,13 @@ gjs_object_from_g_object(JSContext *context,
obj = gjs_construct_object_dynamic(context, proto,
0, NULL);
+ unthreadsafe_template_for_constructor.info = NULL;
+ unthreadsafe_template_for_constructor.gobj = NULL;
+
g_base_info_unref( (GIBaseInfo*) info);
- g_assert(peek_js_obj(context, gobj) == obj);
+ if (obj != NULL)
+ g_assert(peek_js_obj(context, gobj) == obj);
}
return obj;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]