From 4fff14c955917fb4a141c7a47ed0712b9fa30f33 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 1 Oct 2008 08:09:45 +0000 Subject: [PATCH] fixing release handling of dc git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56003 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/graphics.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index a25d643ccd..d824659040 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -1393,10 +1393,12 @@ wxGraphicsMatrix wxGDIPlusContext::GetTransform() const void wxGDIPlusContext::GetSize( wxDouble* width, wxDouble *height ) { + HDC hdc = m_context->GetHDC(); if ( width ) - *width = ::GetDeviceCaps(m_context->GetHDC(), HORZRES); + *width = ::GetDeviceCaps(hdc, HORZRES); if ( height ) - *height = ::GetDeviceCaps(m_context->GetHDC(), VERTRES); + *height = ::GetDeviceCaps(hdc, VERTRES); + m_context->ReleaseHDC(hdc); } //----------------------------------------------------------------------------- -- 2.45.2