gtk: Avoid computing window-intersection when widget is destroyed.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Thu, 30 Aug 2012 20:28:29 +0000 (13:28 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Thu, 30 Aug 2012 20:28:29 +0000 (13:28 -0700)
src/gtk/fix-layout.scm

index b265f2c76e83f82e11f0fc841bd439c47bc9c602..1fe0eedc4d4850cab40aba4f4f2cd5511daaba1f 100644 (file)
@@ -883,14 +883,16 @@ USA.
                (not (fix:zero? (fix-rect-height extent))))
           (for-each
             (lambda (widget)
-              (let ((intersect (let ((v (fix-layout-view widget)))
-                                 (and (fix-rect-nominal? v)
-                                      (window-intersection v extent)))))
-                (if (and intersect (not (gtk-widget-destroyed? widget)))
-                    (C-call "gtk_widget_queue_draw_area"
-                            (gobject-alien widget)
-                            (fix-rect-x intersect) (fix-rect-y intersect)
-                            (fix-rect-width intersect) (fix-rect-height intersect)))))
+              (if (not (gtk-widget-destroyed? widget))
+                  (let ((intersect (let ((v (fix-layout-view widget)))
+                                     (and (fix-rect-nominal? v)
+                                          (window-intersection v extent)))))
+                    (if intersect
+                        (C-call "gtk_widget_queue_draw_area"
+                                (gobject-alien widget)
+                                (fix-rect-x intersect) (fix-rect-y intersect)
+                                (fix-rect-width intersect)
+                                (fix-rect-height intersect))))))
             (let ((widgets (fix-ink-widgets ink)))
               (if (eq? #t widgets)
                   (fix-drawing-widgets drawing)