gtk+ r19933 - in trunk: . gdk/quartz



Author: rhult
Date: Tue Mar 25 13:35:20 2008
New Revision: 19933
URL: http://svn.gnome.org/viewvc/gtk+?rev=19933&view=rev

Log:
2008-03-25  Richard Hult  <richard imendio com>

	* gdk/quartz/gdkwindow-quartz.c:
	(gdk_window_quartz_process_all_updates): Plug a leak and add a
	check that we have a toplevel before accessing it.


Modified:
   trunk/ChangeLog
   trunk/gdk/quartz/gdkwindow-quartz.c

Modified: trunk/gdk/quartz/gdkwindow-quartz.c
==============================================================================
--- trunk/gdk/quartz/gdkwindow-quartz.c	(original)
+++ trunk/gdk/quartz/gdkwindow-quartz.c	Tue Mar 25 13:35:20 2008
@@ -347,19 +347,24 @@
     {
       GdkWindow *window = tmp_list->data;
       GdkWindow *toplevel;
-      NSWindow *nswindow;
-      GdkWindowObject *private;
-      GdkWindowImplQuartz *impl;
 
+      /* Only flush each toplevel at most once. */
       toplevel = gdk_window_get_toplevel (window);
-      private = (GdkWindowObject *) toplevel;
-      impl = (GdkWindowImplQuartz *) private->impl;
-      nswindow = impl->toplevel;
-
-      if (nswindow && ![nswindow isFlushWindowDisabled]) 
+      if (toplevel)
         {
-          [nswindow disableFlushWindow];
-          nswindows = g_slist_prepend (nswindows, nswindow);
+          GdkWindowObject *private;
+          GdkWindowImplQuartz *impl;
+          NSWindow *nswindow;
+
+          private = (GdkWindowObject *) toplevel;
+          impl = (GdkWindowImplQuartz *) private->impl;
+          nswindow = impl->toplevel;
+
+          if (nswindow && ![nswindow isFlushWindowDisabled]) 
+            {
+              [nswindow disableFlushWindow];
+              nswindows = g_slist_prepend (nswindows, nswindow);
+            }
         }
 
       gdk_window_quartz_process_updates_internal (tmp_list->data);
@@ -368,14 +373,15 @@
       tmp_list = tmp_list->next;
     }
 
-  while (nswindows) 
+  tmp_list = nswindows;
+  while (tmp_list) 
     {
-      NSWindow *nswindow = nswindows->data;
+      NSWindow *nswindow = tmp_list->data;
 
       [nswindow enableFlushWindow];
       [nswindow flushWindow];
 
-      nswindows = nswindows->next;
+      tmp_list = tmp_list->next;
     }
 		    
   GDK_QUARTZ_RELEASE_POOL;



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