iochan_man_destroy destroys channels
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 11 Mar 2010 13:56:34 +0000 (14:56 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 11 Mar 2010 13:56:34 +0000 (14:56 +0100)
src/eventl.c

index 3eff731..40f7a69 100644 (file)
@@ -78,8 +78,17 @@ void iochan_man_destroy(iochan_man_t *mp)
 {
     if (*mp)
     {
+        IOCHAN c;
         if ((*mp)->sel_thread)
             sel_thread_destroy((*mp)->sel_thread);
+        
+        c = (*mp)->channel_list;
+        while (c)
+        {
+            IOCHAN c_next = c->next;
+            xfree(c);
+            c = c_next;
+        }
         xfree(*mp);
         *mp = 0;
     }