From: Colin Leroy Date: Wed, 29 Aug 2007 16:39:17 +0000 (+0000) Subject: 2007-08-29 [colin] 2.10.0cvs183 X-Git-Tag: rel_3_0_0~9 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=347a9cd0d3faf37342d319136022337f02df127f;ds=sidebyside 2007-08-29 [colin] 2.10.0cvs183 * src/plugins/trayicon/trayicon.c Fix leak of hooks in case of error, thanks to Holger Berndt --- diff --git a/ChangeLog b/ChangeLog index 4a9082061..df696da41 100644 --- 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 diff --git a/PATCHSETS b/PATCHSETS index 77508ea21..752e399a3 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2837,3 +2837,4 @@ ( 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 diff --git a/configure.ac b/configure.ac index 16e3631bd..d538d27ab 100644 --- a/configure.ac +++ b/configure.ac @@ -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= diff --git a/src/plugins/trayicon/trayicon.c b/src/plugins/trayicon/trayicon.c index 4f01ce88d..c2cd4e99c 100644 --- a/src/plugins/trayicon/trayicon.c +++ b/src/plugins/trayicon/trayicon.c @@ -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)