[gnome-notes] biji-timeout: connect "shutdown" signal handler only once
- From: Isaque Galdino de Araujo <igaldino src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-notes] biji-timeout: connect "shutdown" signal handler only once
- Date: Fri, 26 Mar 2021 23:32:35 +0000 (UTC)
commit 8491d75bf892d6c8ebf0127ed2b0fb31a6d3c913
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date: Wed Mar 17 18:57:42 2021 +0530
biji-timeout: connect "shutdown" signal handler only once
Otherwise the callback may run multiple times which is not desired
src/libbiji/biji-timeout.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/libbiji/biji-timeout.c b/src/libbiji/biji-timeout.c
index 4176e6f..6e83da9 100644
--- a/src/libbiji/biji-timeout.c
+++ b/src/libbiji/biji-timeout.c
@@ -119,6 +119,7 @@ biji_timeout_reset (BijiTimeout *self, guint millis)
millis, (GSourceFunc) biji_timeout_callback, self);
/* Ensure to perform timeout if main loop ends */
- self->quit = g_signal_connect_swapped (g_application_get_default(), "shutdown",
- G_CALLBACK (biji_timeout_expired), self);
+ if (!self->quit)
+ self->quit = g_signal_connect_swapped (g_application_get_default(), "shutdown",
+ G_CALLBACK (biji_timeout_expired), self);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]