From 5c151fb52d5445352c04b24ac85964744ba00b37 Mon Sep 17 00:00:00 2001 From: Charles Brej Date: Thu, 16 Oct 2008 11:44:40 +0100 Subject: [PATCH] Don't free ply_event_source unless destinations refcount is 0 --- src/libply/ply-event-loop.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libply/ply-event-loop.c b/src/libply/ply-event-loop.c index fe7edbcc..a4a62e06 100644 --- a/src/libply/ply-event-loop.c +++ b/src/libply/ply-event-loop.c @@ -1116,8 +1116,11 @@ ply_event_loop_disconnect_source (ply_event_loop_t *loop, ply_event_loop_free_destinations_for_source (loop, source); assert (ply_list_get_length (source->destinations) == 0); - ply_event_loop_remove_source (loop, source); - ply_event_source_free (source); + if (ply_list_get_length (source->destinations) == 0) + { + ply_event_loop_remove_source (loop, source); + ply_event_source_free (source); + } } static void -- 2.47.3