fixing release handling of dc

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56003 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2008-10-01 08:09:45 +00:00
parent e98c72eccb
commit 4fff14c955

View File

@ -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);
}
//-----------------------------------------------------------------------------