From 611f5526e9f41ad7cef14ff18ffadc307f262fb9 Mon Sep 17 00:00:00 2001 From: Richard Hult Date: Sun, 3 Sep 2006 10:46:32 +0000 Subject: [PATCH] Don't do anything if exposure isn't in the event mask, plug a leak, and 2006-09-03 Richard Hult * gdk/quartz/GdkQuartzView.c (drawRect): Don't do anything if exposure isn't in the event mask, plug a leak, and check that the window isn't destroyed. (isOpaque): Check that the window isn't destroyed, fixes bug #353028. --- ChangeLog | 8 ++++++++ gdk/quartz/GdkQuartzView.c | 12 +++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f84cde34d3..18791dfc39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-09-03 Richard Hult + + * gdk/quartz/GdkQuartzView.c (drawRect): Don't do anything if + exposure isn't in the event mask, plug a leak, and check that the + window isn't destroyed. + (isOpaque): Check that the window isn't destroyed, fixes bug + #353028. + 2006-09-03 Matthias Clasen * gtk/gtkwidget.c (gtk_widget_class_init): Fix a typo. diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c index 7cd68ead94..cc0cd858f4 100644 --- a/gdk/quartz/GdkQuartzView.c +++ b/gdk/quartz/GdkQuartzView.c @@ -42,6 +42,9 @@ -(BOOL)isOpaque { + if (GDK_WINDOW_DESTROYED (gdk_window)) + return YES; + /* A view is opaque if its GdkWindow doesn't have the RGBA colormap */ return gdk_drawable_get_colormap (gdk_window) != gdk_screen_get_rgba_colormap (_gdk_screen); } @@ -55,6 +58,12 @@ int count, i; GdkRegion *region; + if (GDK_WINDOW_DESTROYED (gdk_window)) + return; + + if (!(private->event_mask & GDK_EXPOSURE_MASK)) + return; + GDK_QUARTZ_ALLOC_POOL; [self getRectsBeingDrawn:&drawn_rects count:&count]; @@ -94,9 +103,10 @@ impl->in_paint_rect_count --; g_object_unref (gdk_window); - gdk_region_destroy (event.expose.region); } + gdk_region_destroy (region); + GDK_QUARTZ_RELEASE_POOL; }