[gtk+/rendering-cleanup: 77/95] gdk: Don't infinite loop when flushing moves



commit fc7a0eb537d53754ae06914b02aee2991ea85456
Author: Benjamin Otte <otte redhat com>
Date:   Thu Aug 5 02:26:59 2010 +0200

    gdk: Don't infinite loop when flushing moves
    
    Spotted by Kristian Rietvield. Fixes testoffscreen test.

 gdk/gdkwindow.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 81f3ab3..5797591 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -3409,14 +3409,16 @@ gdk_window_flush_outstanding_moves (GdkWindow *window)
 {
   GdkWindowObject *private;
   GdkWindowObject *impl_window;
-  GList *l;
+  GList *l, *outstanding;
   GdkWindowRegionMove *move;
 
   private = (GdkWindowObject *) window;
 
   impl_window = gdk_window_get_impl_window (private);
+  outstanding = impl_window->outstanding_moves;
+  impl_window->outstanding_moves = NULL;
 
-  for (l = impl_window->outstanding_moves; l != NULL; l = l->next)
+  for (l = outstanding; l != NULL; l = l->next)
     {
       move = l->data;
 
@@ -3426,8 +3428,7 @@ gdk_window_flush_outstanding_moves (GdkWindow *window)
       gdk_window_region_move_free (move);
     }
 
-  g_list_free (impl_window->outstanding_moves);
-  impl_window->outstanding_moves = NULL;
+  g_list_free (outstanding);
 }
 
 /**



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