2007-08-29 [colin] 2.10.0cvs183
authorColin Leroy <colin@colino.net>
Wed, 29 Aug 2007 16:39:17 +0000 (16:39 +0000)
committerColin Leroy <colin@colino.net>
Wed, 29 Aug 2007 16:39:17 +0000 (16:39 +0000)
* src/plugins/trayicon/trayicon.c
Fix leak of hooks in case of error,
thanks to Holger Berndt

ChangeLog
PATCHSETS
configure.ac
src/plugins/trayicon/trayicon.c

index 4a9082061deabc480d3311076e1d86e53cb05061..df696da410974b87769b9723102ce17a93955204 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-08-29 [colin]     2.10.0cvs183
+
+       * src/plugins/trayicon/trayicon.c
+               Fix leak of hooks in case of error,
+               thanks to Holger Berndt
+
 2007-08-28 [colin]     2.10.0cvs182
 
        * src/mainwindow.c
index 77508ea21ab182f0a8792251a39ea74ca74ea180..752e399a33136e61918eab55ebacb9b11c7a105c 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.403 -r 1.382.2.404 src/compose.c;  cvs diff -u -r 1.50.2.41 -r 1.50.2.42 src/compose.h;  ) > 2.10.0cvs180.patchset
 ( cvs diff -u -r 1.22.2.35 -r 1.22.2.36 src/quote_fmt_parse.y;  ) > 2.10.0cvs181.patchset
 ( cvs diff -u -r 1.274.2.207 -r 1.274.2.208 src/mainwindow.c;  ) > 2.10.0cvs182.patchset
+( cvs diff -u -r 1.14.2.58 -r 1.14.2.59 src/plugins/trayicon/trayicon.c;  ) > 2.10.0cvs183.patchset
index 16e3631bd893dd53f98da60f7db0c1cb3756ec62..d538d27ab2fd194646a5ccf098ea8da8f8ad8651 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=10
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=182
+EXTRA_VERSION=183
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 4f01ce88da47870b3eec2fef3e7d7d16797a1b4f..c2cd4e99c13cab904914f2141581191616adeab1 100644 (file)
@@ -402,37 +402,37 @@ int plugin_init(gchar **error)
        item_hook_id = hooks_register_hook (FOLDER_ITEM_UPDATE_HOOKLIST, folder_item_update_hook, NULL);
        if (item_hook_id == -1) {
                *error = g_strdup(_("Failed to register folder item update hook"));
-               return -1;
+               goto err_out_item;
        }
 
        folder_hook_id = hooks_register_hook (FOLDER_UPDATE_HOOKLIST, folder_update_hook, NULL);
        if (folder_hook_id == -1) {
                *error = g_strdup(_("Failed to register folder update hook"));
-               return -1;
+               goto err_out_folder;
        }
 
        offline_hook_id = hooks_register_hook (OFFLINE_SWITCH_HOOKLIST, offline_update_hook, NULL);
        if (offline_hook_id == -1) {
                *error = g_strdup(_("Failed to register offline switch hook"));
-               return -1;
+               goto err_out_offline;
        }
 
        account_hook_id = hooks_register_hook (ACCOUNT_LIST_CHANGED_HOOKLIST, trayicon_set_accounts_hook, NULL);
        if (account_hook_id == -1) {
                *error = g_strdup(_("Failed to register account list changed hook"));
-               return -1;
+               goto err_out_account;
        }
 
        close_hook_id = hooks_register_hook (MAIN_WINDOW_CLOSE, trayicon_close_hook, NULL);
        if (close_hook_id == -1) {
                *error = g_strdup(_("Failed to register close hook"));
-               return -1;
+               goto err_out_close;
        }
 
        iconified_hook_id = hooks_register_hook (MAIN_WINDOW_GOT_ICONIFIED, trayicon_got_iconified_hook, NULL);
        if (iconified_hook_id == -1) {
                *error = g_strdup(_("Failed to register got iconified hook"));
-               return -1;
+               goto err_out_iconified;
        }
 
        create_trayicon();
@@ -449,6 +449,19 @@ int plugin_init(gchar **error)
        }
 
        return 0;
+
+err_out_iconified:
+       hooks_unregister_hook(MAIN_WINDOW_CLOSE, close_hook_id);
+err_out_close:
+       hooks_unregister_hook(ACCOUNT_LIST_CHANGED_HOOKLIST, account_hook_id);
+err_out_account:
+       hooks_unregister_hook(OFFLINE_SWITCH_HOOKLIST, offline_hook_id);
+err_out_offline:
+       hooks_unregister_hook(FOLDER_UPDATE_HOOKLIST, folder_hook_id);
+err_out_folder:
+       hooks_unregister_hook(FOLDER_ITEM_UPDATE_HOOKLIST, item_hook_id);
+err_out_item:
+       return -1;
 }
 
 gboolean plugin_done(void)