diff options
author | Timo Sirainen <cras@irssi.org> | 2001-10-21 10:22:55 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-10-21 10:22:55 +0000 |
commit | b5fa93c6e7a31f9ce50b8a39276adf56002f3f78 (patch) | |
tree | 6f782576d03459fc24e873847c7db9dbb3d900b2 | |
parent | a5142ec3113a44ee8253a3c314c7c5246eb9d273 (diff) | |
download | irssi-b5fa93c6e7a31f9ce50b8a39276adf56002f3f78.zip |
Statusbar items weren't unregistered correctly when script was unloaded.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1871 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | src/perl/textui/Statusbar.xs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/perl/textui/Statusbar.xs b/src/perl/textui/Statusbar.xs index d512a3ab..2fda8c81 100644 --- a/src/perl/textui/Statusbar.xs +++ b/src/perl/textui/Statusbar.xs @@ -4,8 +4,9 @@ static GHashTable *perl_sbar_defs; static int check_sbar_destroy(char *key, char *value, char *script) { - if (strncmp(key, script, strlen(script)) == 0 && - key[strlen(script)] == ':') { + if (strncmp(value, script, strlen(script)) == 0 && + value[strlen(script)] == ':') { + statusbar_item_unregister(key); g_free(key); g_free(value); return TRUE; @@ -14,18 +15,18 @@ static int check_sbar_destroy(char *key, char *value, char *script) return FALSE; } -static void sig_script_destroy(PERL_SCRIPT_REC *script) +static void sig_script_destroyed(PERL_SCRIPT_REC *script) { g_hash_table_foreach_remove(perl_sbar_defs, (GHRFunc) check_sbar_destroy, - script->name); + script->package); } void perl_statusbar_init(void) { perl_sbar_defs = g_hash_table_new((GHashFunc) g_str_hash, (GCompareFunc) g_str_equal); - signal_add("script destroy", (SIGNAL_FUNC) sig_script_destroy); + signal_add("script destroyed", (SIGNAL_FUNC) sig_script_destroyed); } static void statusbar_item_def_destroy(void *key, void *value) @@ -36,7 +37,7 @@ static void statusbar_item_def_destroy(void *key, void *value) void perl_statusbar_deinit(void) { - signal_remove("script destroy", (SIGNAL_FUNC) sig_script_destroy); + signal_remove("script destroyed", (SIGNAL_FUNC) sig_script_destroyed); g_hash_table_foreach(perl_sbar_defs, (GHFunc) statusbar_item_def_destroy, NULL); |