[gtk+] Bug #588398 - Leak with testgtk::preview_(color|gray) and more
- From: Hans Breuer <hans src gnome org>
- To: svn-commits-list gnome org
- Subject: [gtk+] Bug #588398 - Leak with testgtk::preview_(color|gray) and more
- Date: Sat, 18 Jul 2009 11:34:21 +0000 (UTC)
commit f3668e96e78d7a060f9affa8f6dc6fe15251c5b1
Author: Hans Breuer <hans breuer org>
Date: Sat Jul 18 13:08:13 2009 +0200
Bug #588398 - Leak with testgtk::preview_(color|gray) and more
Revert to gdk_win32_ref_cairo_surface() implementation from gtk-2-16
and make _gdk_windowing_create_cairo_surface() simply delegate to it.
gdk/win32/gdkdrawable-win32.c | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c
index d5a4376..8975c9c 100644
--- a/gdk/win32/gdkdrawable-win32.c
+++ b/gdk/win32/gdkdrawable-win32.c
@@ -1883,10 +1883,8 @@ _gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
gint width,
gint height)
{
- HDC hdc = _gdk_win32_drawable_acquire_dc (drawable);
- if (!hdc)
- return NULL;
- return cairo_win32_surface_create (hdc);
+ /* width and height are determined from the DC */
+ return gdk_win32_ref_cairo_surface (drawable);
}
static void
@@ -1909,16 +1907,17 @@ gdk_win32_ref_cairo_surface (GdkDrawable *drawable)
if (!impl->cairo_surface)
{
- // On Win32 cairo surface, width and height are determined from the DC
- impl->cairo_surface = _gdk_windowing_create_cairo_surface (drawable, 0, 0);
+ HDC hdc = _gdk_win32_drawable_acquire_dc (drawable);
+ if (!hdc)
+ return NULL;
+
+ impl->cairo_surface = cairo_win32_surface_create (hdc);
cairo_surface_set_user_data (impl->cairo_surface, &gdk_win32_cairo_key,
drawable, gdk_win32_cairo_surface_destroy);
}
else
- {
- cairo_surface_reference (impl->cairo_surface);
- }
+ cairo_surface_reference (impl->cairo_surface);
return impl->cairo_surface;
}
@@ -1977,6 +1976,6 @@ _gdk_win32_drawable_finish (GdkDrawable *drawable)
cairo_surface_set_user_data (impl->cairo_surface, &gdk_win32_cairo_key, NULL, NULL);
}
- //TODO_CSW: g_assert (impl->hdc_count == 0);
+ g_assert (impl->hdc_count == 0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]