gnumeric r17048 - in trunk: . src



Author: mortenw
Date: Tue Dec 30 18:39:47 2008
New Revision: 17048
URL: http://svn.gnome.org/viewvc/gnumeric?rev=17048&view=rev

Log:
2008-12-30  Morten Welinder  <terra gnome org>

	* src/main-application.c (main): Conditionalize closing of
	displays.  Set GNM_DEBUG=close-displays.



Modified:
   trunk/ChangeLog
   trunk/src/main-application.c

Modified: trunk/src/main-application.c
==============================================================================
--- trunk/src/main-application.c	(original)
+++ trunk/src/main-application.c	Tue Dec 30 18:39:47 2008
@@ -348,6 +348,33 @@
 	}
 }
 
+enum {
+	GNM_DEBUG_CLOSE_DISPLAY = 1
+};
+
+static gboolean
+debug_flags (guint test)
+{
+	static guint flags;
+	static gboolean inited = FALSE;
+
+	if (!inited) {
+		/* not static */
+		const GDebugKey keys[] = {
+			{ (char*)"close-displays", GNM_DEBUG_CLOSE_DISPLAY },
+		};
+
+		const char *val = g_getenv ("GNM_DEBUG");
+		flags = val
+			? g_parse_debug_string (val, keys, G_N_ELEMENTS (keys))
+			: 0;
+
+		inited = TRUE;
+	}
+
+	return (flags & test) != 0;
+}
+
 
 int
 main (int argc, char const **argv)
@@ -543,7 +570,7 @@
 	 * This helps finding leaks.  We might want it in developent
 	 * only.
 	 */
-	if (with_gui && (GNM_VERSION_MAJOR & 1)) {
+	if (with_gui && debug_flags (GNM_DEBUG_CLOSE_DISPLAY)) {
 		GSList *displays;
 
 		gdk_flush();



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