aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-01-18 17:06:28 -0600
committerTed Gould <ted@gould.cx>2011-01-18 17:06:28 -0600
commit43b377b84c868f652e8ea0db989b985cf20a3304 (patch)
tree65dc2935a2e84511ac531802313ef277c6a995e7
parent5d6f408aad06b27f8d29b52df9bd8d76155eabe4 (diff)
downloadlibdbusmenu-43b377b84c868f652e8ea0db989b985cf20a3304.tar.gz
libdbusmenu-43b377b84c868f652e8ea0db989b985cf20a3304.tar.bz2
libdbusmenu-43b377b84c868f652e8ea0db989b985cf20a3304.zip
Clean up on failure
-rw-r--r--libdbusmenu-gtk/serializablemenuitem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libdbusmenu-gtk/serializablemenuitem.c b/libdbusmenu-gtk/serializablemenuitem.c
index 16b3910..1d4703f 100644
--- a/libdbusmenu-gtk/serializablemenuitem.c
+++ b/libdbusmenu-gtk/serializablemenuitem.c
@@ -118,7 +118,9 @@ dbusmenu_gtk_serializable_menu_item_register_to_client (DbusmenuClient * client,
type_handler_t * th = g_new0(type_handler_t, 1);
th->class = class;
th->type = item_type;
- dbusmenu_client_add_type_handler_full(client, class->get_type_string(), type_handler, th, type_destroy_handler); /* need type */
+ if (!dbusmenu_client_add_type_handler_full(client, class->get_type_string(), type_handler, th, type_destroy_handler)) {
+ type_destroy_handler(client, class->get_type_string(), th);
+ }
/* Register defaults */
/* TODO: Need API on another branch */