[evolution-data-server/gnome-3-38] AlarmNotify: The e_alarm_notify_activate() can be called multiple times



commit e71a3f56edae39ce45d5073305c9fecd6d34181b
Author: Milan Crha <mcrha redhat com>
Date:   Tue Feb 9 13:51:02 2021 +0100

    AlarmNotify: The e_alarm_notify_activate() can be called multiple times
    
    Initialize internal structures only the first time the e_alarm_notify_activate()
    is called, otherwise some of the objects can be duplicated and waste resources.

 src/services/evolution-alarm-notify/e-alarm-notify.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/services/evolution-alarm-notify/e-alarm-notify.c 
b/src/services/evolution-alarm-notify/e-alarm-notify.c
index 2e42671ee..4d00fc3d8 100644
--- a/src/services/evolution-alarm-notify/e-alarm-notify.c
+++ b/src/services/evolution-alarm-notify/e-alarm-notify.c
@@ -1093,6 +1093,9 @@ e_alarm_notify_activate (GApplication *application)
 
        g_return_if_fail (an->priv->registry != NULL);
 
+       if (an->priv->watcher)
+               return;
+
        an->priv->watcher = e_reminder_watcher_new (an->priv->registry);
        an->priv->reminders = e_reminders_widget_new (an->priv->watcher);
        an->priv->settings = g_object_ref (e_reminders_widget_get_settings (an->priv->reminders));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]