aboutsummaryrefslogtreecommitdiff
path: root/src/core/mainloop/periodic.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/mainloop/periodic.c')
-rw-r--r--src/core/mainloop/periodic.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/mainloop/periodic.c b/src/core/mainloop/periodic.c
index c0363b15ea..5c01213d17 100644
--- a/src/core/mainloop/periodic.c
+++ b/src/core/mainloop/periodic.c
@@ -133,6 +133,11 @@ periodic_event_destroy(periodic_event_item_t *event)
{
if (!event)
return;
+
+ /* First disable the event so we first cancel the event and set its enabled
+ * flag properly. */
+ periodic_event_disable(event);
+
mainloop_event_free(event->ev);
event->last_action_time = 0;
}