summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-02-17 15:20:51 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-02-17 15:20:51 +0000
commitea6e51d583bde53514e7589267ba55f55b8a23e6 (patch)
treeeb295d06b0413f4227e92065089ab1e5b5043fe3 /common
parent66988386d4c05270a03f93257fdbbeac9bf047f0 (diff)
Fix handling of D-Bus disconnect signal
Diffstat (limited to 'common')
-rw-r--r--common/glib-ectomy.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/common/glib-ectomy.c b/common/glib-ectomy.c
index bea7f47c..7c1f9d9f 100644
--- a/common/glib-ectomy.c
+++ b/common/glib-ectomy.c
@@ -92,7 +92,7 @@ void g_io_remove_watch(guint id)
{
struct watch *w, *p;
- for (p = &watch_head, w = watch_head.next; w; w = w->next)
+ for (p = &watch_head, w = watch_head.next; w; p = w, w = w->next)
if (w->id == id) {
p->next = w->next;
free (w);
@@ -181,5 +181,12 @@ void g_main_loop_run(GMainLoop *loop)
void g_main_loop_quit(GMainLoop *loop)
{
+ struct watch *w;
+
loop->bail = 1;
+
+ for (w = watch_head.next; w; w = w->next) {
+ watch_head.next = w->next;
+ free (w);
+ }
}