diff options
author | fujiwarat <takao.fujiwara1@gmail.com> | 2012-09-17 12:12:15 +0900 |
---|---|---|
committer | fujiwarat <takao.fujiwara1@gmail.com> | 2012-09-17 12:12:15 +0900 |
commit | b4fb74727f39697ce94c2c8a37f46044f357e17e (patch) | |
tree | 4e119dbd21f7dad26be08a8f7301edc33c0cb69e /bus | |
parent | ea36002109cfaba8e78265a4398c17a1114fd3fe (diff) |
Fix SIGABRT in bus_panel_proxy_register_properties
TEST=Manually
Review URL: https://codereview.appspot.com/6499112
Diffstat (limited to 'bus')
-rw-r--r-- | bus/engineproxy.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/bus/engineproxy.c b/bus/engineproxy.c index 4d8c18be..49df07a3 100644 --- a/bus/engineproxy.c +++ b/bus/engineproxy.c @@ -63,8 +63,10 @@ struct _BusEngineProxy { struct _BusEngineProxyClass { IBusProxyClass parent; /* class members */ - void (* register_properties) (IBusPropList *prop_list); - void (* update_property) (IBusProperty *prop); + void (* register_properties) (BusEngineProxy *engine, + IBusPropList *prop_list); + void (* update_property) (BusEngineProxy *engine, + IBusProperty *prop); }; enum { @@ -98,6 +100,7 @@ enum { static guint engine_signals[LAST_SIGNAL] = { 0 }; static IBusText *text_empty = NULL; +static IBusPropList *prop_list_empty = NULL; /* functions prototype */ static void bus_engine_proxy_set_property (BusEngineProxy *engine, @@ -368,12 +371,16 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class) text_empty = ibus_text_new_from_static_string (""); g_object_ref_sink (text_empty); + + prop_list_empty = ibus_prop_list_new (); + g_object_ref_sink (prop_list_empty); } static void bus_engine_proxy_init (BusEngineProxy *engine) { engine->surrounding_text = g_object_ref_sink (text_empty); + engine->prop_list = g_object_ref_sink (prop_list_empty); } static void @@ -412,7 +419,9 @@ static void bus_engine_proxy_real_register_properties (BusEngineProxy *engine, IBusPropList *prop_list) { - if (engine->prop_list) + g_assert (IBUS_IS_PROP_LIST (prop_list)); + + if (engine->prop_list != prop_list_empty) g_object_unref (engine->prop_list); engine->prop_list = (IBusPropList *) g_object_ref_sink (prop_list); } |