From: Stefan Csomor Date: Wed, 1 Oct 2008 08:09:45 +0000 (+0000) Subject: fixing release handling of dc X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4fff14c955917fb4a141c7a47ed0712b9fa30f33?ds=inline fixing release handling of dc git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56003 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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); } //-----------------------------------------------------------------------------