aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchen@src.gnome.org>2005-10-03 18:12:05 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2005-10-03 18:12:05 +0800
commit0f927224fe992116c0710c9fb15ddfd7d5f6fb61 (patch)
tree165c5edca6c551c345cb94ca55ad573539d0bd4e
parent651529309714d5e0116069cb1d59abc918f73cc2 (diff)
downloadgsoc2013-evolution-0f927224fe992116c0710c9fb15ddfd7d5f6fb61.tar
gsoc2013-evolution-0f927224fe992116c0710c9fb15ddfd7d5f6fb61.tar.gz
gsoc2013-evolution-0f927224fe992116c0710c9fb15ddfd7d5f6fb61.tar.bz2
gsoc2013-evolution-0f927224fe992116c0710c9fb15ddfd7d5f6fb61.tar.lz
gsoc2013-evolution-0f927224fe992116c0710c9fb15ddfd7d5f6fb61.tar.xz
gsoc2013-evolution-0f927224fe992116c0710c9fb15ddfd7d5f6fb61.tar.zst
gsoc2013-evolution-0f927224fe992116c0710c9fb15ddfd7d5f6fb61.zip
fixes 271480.
svn path=/trunk/; revision=30473
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gui/alarm-notify/notify-main.c7
2 files changed, 14 insertions, 0 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 7e94b4054c..c9bee9ebdb 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,10 @@
+2005-10-03 Chenthill Palanisamy <pchenthill@novell.com>
+
+ Fixes #271480
+ * gui/alarm-notify/notify-main.c: (alarm_notify_factory_fn),
+ (init_alarm_service): Added a global static mutex to ensure
+ the alarm_notify object is created only once.
+
2005-10-03 Mubeen Jukaku <jmubeen@novell.com>
Fixes #264449
diff --git a/calendar/gui/alarm-notify/notify-main.c b/calendar/gui/alarm-notify/notify-main.c
index b6f60222b5..4dca946d76 100644
--- a/calendar/gui/alarm-notify/notify-main.c
+++ b/calendar/gui/alarm-notify/notify-main.c
@@ -52,6 +52,8 @@ static BonoboGenericFactory *factory;
static AlarmNotify *alarm_notify_service = NULL;
+/* to ensure alarm_notify object is created only once */
+GStaticMutex mutex_init = G_STATIC_MUTEX_INIT;
/* Callback for the master client's "die" signal. We must terminate the daemon
* since the session is ending.
@@ -104,6 +106,7 @@ init_session (void)
static BonoboObject *
alarm_notify_factory_fn (BonoboGenericFactory *factory, const char *component_id, void *data)
{
+ g_static_mutex_lock (&mutex_init);
if (!alarm_notify_service) {
alarm_notify_service = alarm_notify_new ();
g_assert (alarm_notify_service != NULL);
@@ -111,6 +114,7 @@ alarm_notify_factory_fn (BonoboGenericFactory *factory, const char *component_id
bonobo_object_ref (BONOBO_OBJECT (alarm_notify_service));
+ g_static_mutex_unlock (&mutex_init);
return BONOBO_OBJECT (alarm_notify_service);
}
@@ -118,10 +122,13 @@ alarm_notify_factory_fn (BonoboGenericFactory *factory, const char *component_id
static gboolean
init_alarm_service (gpointer user_data)
{
+ if (!g_static_mutex_trylock (&mutex_init))
+ return FALSE;
if (!alarm_notify_service) {
alarm_notify_service = alarm_notify_new ();
g_assert (alarm_notify_service != NULL);
}
+ g_static_mutex_unlock (&mutex_init);
return FALSE;
}