summaryrefslogtreecommitdiff
path: root/gdk/win32
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2006-06-09 09:17:47 +0000
committerTor Lillqvist <tml@src.gnome.org>2006-06-09 09:17:47 +0000
commit225d9caf7c7128ad397a7b6c9b6035df1b72bd8b (patch)
treef97f3dcb2791fcec01c0607a8c0d953a12a517f3 /gdk/win32
parentada7aa635ee22c0b56050342711468629fadcbbe (diff)
downloadgtk+-225d9caf7c7128ad397a7b6c9b6035df1b72bd8b.tar.gz
Call ReleaseDC() on DCs acquired with GetDC() (for windows), and
2006-06-09 Tor Lillqvist <tml@novell.com> * gdk/win32/gdkdrawable-win32.c (_gdk_win32_drawable_release_dc): Call ReleaseDC() on DCs acquired with GetDC() (for windows), and DeleteDC() on DCs acquired with CreateCompatibleDC() (for bitmaps). According to MSDN, this is the correct thing to do, even if always using DeleteDC() seems to have worked fine in practice. (#337491)
Diffstat (limited to 'gdk/win32')
-rw-r--r--gdk/win32/gdkdrawable-win32.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c
index d14dfc1d88..9171ca35c2 100644
--- a/gdk/win32/gdkdrawable-win32.c
+++ b/gdk/win32/gdkdrawable-win32.c
@@ -1889,7 +1889,10 @@ _gdk_win32_drawable_release_dc (GdkDrawable *drawable)
if (impl->hdc)
{
- GDI_CALL (DeleteDC, (impl->hdc));
+ if (GDK_IS_PIXMAP_IMPL_WIN32 (impl))
+ GDI_CALL (DeleteDC, (impl->hdc));
+ else
+ GDI_CALL (ReleaseDC, (impl->handle, impl->hdc));
impl->hdc = NULL;
}
}