summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDom Lachowicz <domlachowicz@gmail.com>2007-02-05 14:30:06 +0000
committerDom Lachowicz <doml@src.gnome.org>2007-02-05 14:30:06 +0000
commit47b8d98aba689af51337f34fe54ceb5e8390bfd1 (patch)
treeb8f5ea3109cd6a68d5ae8eedb8d25299961f4592 /modules
parent17fed85c24c8280217e4ebf6c75f691595abd887 (diff)
downloadgdk-pixbuf-47b8d98aba689af51337f34fe54ceb5e8390bfd1.tar.gz
Fix bug 404506, caused by prematurely releasing a DC. By Hiroyuki Yamamoto
2007-02-05 Dom Lachowicz <domlachowicz@gmail.com> * modules/engines/ms-windows/msw_style.c: Fix bug 404506, caused by prematurely releasing a DC. By Hiroyuki Yamamoto * modules/engines/ms-windows/msw_style.c: Fix bug 403470 - leaking pixbufs when drawing rotated tabs. By Daniel Atallah svn path=/trunk/; revision=17263
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/engines/ms-windows/msw_style.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/engines/ms-windows/msw_style.c b/modules/engines/ms-windows/msw_style.c
index dcb34fd88..a1d2bf6b7 100755
--- a/modules/engines/ms-windows/msw_style.c
+++ b/modules/engines/ms-windows/msw_style.c
@@ -466,12 +466,15 @@ sys_font_to_pango_font (XpThemeClass klazz, XpThemeFont type, char *buf,
{
pt_size = -MulDiv (lf.lfHeight, 72,
GetDeviceCaps (hDC, LOGPIXELSY));
- ReleaseDC (hwnd, hDC);
}
else
pt_size = 10;
font = get_family_name (&lf, hDC);
+
+ if (hDC)
+ ReleaseDC (hwnd, hDC);
+
if(!(font && *font))
return NULL;
@@ -1988,8 +1991,6 @@ draw_box (GtkStyle * style,
{
RECT rect;
HDC dc;
- gboolean rtl = (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL);
- gboolean up = !strcmp (detail, "spinbutton_up");
dc = get_window_dc( style, window, state_type,
x, y, width, height, &rect );
@@ -2409,7 +2410,6 @@ draw_extension (GtkStyle * style,
int tab_part = XP_THEME_ELEMENT_TAB_ITEM;
int real_gap_side = gtk_notebook_get_tab_pos (notebook);
int border_width = gtk_container_get_border_width (GTK_CONTAINER (notebook));
- gboolean last_tab;
/* why this differs from the above gap_side, i have no idea... */
if (real_gap_side == GTK_POS_LEFT)
@@ -2529,6 +2529,8 @@ draw_extension (GtkStyle * style,
gdk_draw_pixbuf (window, NULL, pixbuf, 0, 0, x2, y2, w2, h2, GDK_RGB_DITHER_NONE, 0, 0);
+ g_object_unref (G_OBJECT (pixbuf));
+
if (real_gap_side == GTK_POS_LEFT || real_gap_side == GTK_POS_RIGHT)
{
g_object_unref (pixmap);