--- a/disco.c Thu Nov 05 12:45:24 2009 +0200
+++ b/disco.c Fri Nov 06 00:44:57 2009 +0200
@@ -223,16 +223,14 @@
free_arg_lst (args);
}
-static void disco_free_handlers (void)
+static void disco_free_reply_handlers (void)
{
GSList *hel;
- if (lconnection) { // XXX more checks?
- // let's hope, that after invalidation, lm will remove and free unreffed by us handler
- for (hel = reply_handlers; hel; hel = hel->next) {
- LmMessageHandler *handler = (LmMessageHandler *) hel->data;
- lm_message_handler_invalidate (handler);
- }
+ // let's hope, that after invalidation, lm will remove and free unreffed by us handler
+ for (hel = reply_handlers; hel; hel = hel->next) {
+ LmMessageHandler *handler = (LmMessageHandler *) hel->data;
+ lm_message_handler_invalidate (handler);
}
g_slist_free (reply_handlers);
@@ -242,11 +240,11 @@
// release handlers before reconnect
static void disco_hh (guint32 hid, hk_arg_t *args, gpointer userdata)
{
- hk_arg_t *arg = args;
+ hk_arg_t *arg;
for (arg = args; arg->name; arg++) {
if (!strcmp (arg->name, "hook") && !strcmp (arg->value, "hook-pre-disconnect")) {
- disco_free_handlers ();
+ disco_free_reply_handlers ();
return;
}
}
@@ -275,7 +273,7 @@
void g_module_unload(GModule *module)
{
// release handlers
- disco_free_handlers ();
+ disco_free_reply_handlers ();
// remove hook handler
hk_del_handler (disco_hh, NULL);