From 368cc1fb76dcc721dd2cafdb5dca3ac79e5e7ea6 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 14 Jan 2020 13:28:54 +0000 Subject: [PATCH] malcontent-control: Fix a crash when flushing changes The `GSource` was being removed twice, once in `blacklist_apps_cb()` and once in `flush_update_blacklisted_apps()`, leading to a critical warning from GLib. Signed-off-by: Philip Withnall --- malcontent-control/user-controls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/malcontent-control/user-controls.c b/malcontent-control/user-controls.c index 4ad4a08..3fd235d 100644 --- a/malcontent-control/user-controls.c +++ b/malcontent-control/user-controls.c @@ -305,9 +305,11 @@ flush_update_blacklisted_apps (MctUserControls *self) { if (self->blacklist_apps_source_id > 0) { - blacklist_apps_cb (self); + /* Remove the timer and forcefully call the timer callback. */ g_source_remove (self->blacklist_apps_source_id); self->blacklist_apps_source_id = 0; + + blacklist_apps_cb (self); } }