gnome-main-menu r451 - trunk/libslab



Author: federico
Date: Wed Apr 23 20:37:36 2008
New Revision: 451
URL: http://svn.gnome.org/viewvc/gnome-main-menu?rev=451&view=rev

Log:
Fix for two applet instances that don't start at the same time
2008-04-23  Federico Mena Quintero  <federico novell com>

	* libslab-utils.c (create_thumbnail_factory): Continue the fix for
	the last bug; when a second instance of the applet gets added, it
	will want to initialize the thumbnail factory again.

Signed-off-by: Federico Mena Quintero <federico gnu org>


Modified:
   trunk/libslab/ChangeLog
   trunk/libslab/libslab-utils.c

Modified: trunk/libslab/libslab-utils.c
==============================================================================
--- trunk/libslab/libslab-utils.c	(original)
+++ trunk/libslab/libslab-utils.c	Wed Apr 23 20:37:36 2008
@@ -577,9 +577,14 @@
 static void
 create_thumbnail_factory (void)
 {
+	/* The thumbnail_factory may already have been created by an applet
+	 * instance that was launched before the current one.
+	 */
+	if (thumbnail_factory != NULL)
+		return;
+
 	libslab_checkpoint ("create_thumbnail_factory(): start");
 
-	g_assert (thumbnail_factory == NULL);
 	thumbnail_factory = gnome_thumbnail_factory_new (GNOME_THUMBNAIL_SIZE_NORMAL);
 
 	libslab_checkpoint ("create_thumbnail_factory(): end");
@@ -596,8 +601,7 @@
 void
 libslab_thumbnail_factory_preinit (void)
 {
-	if (thumbnail_factory_idle_id == 0)
-		thumbnail_factory_idle_id = g_idle_add (init_thumbnail_factory_idle_cb, NULL);
+	thumbnail_factory_idle_id = g_idle_add (init_thumbnail_factory_idle_cb, NULL);
 }
 
 GnomeThumbnailFactory *



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