]> git.saurik.com Git - wxWidgets.git/commitdiff
fixing release handling of dc
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 1 Oct 2008 08:09:45 +0000 (08:09 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 1 Oct 2008 08:09:45 +0000 (08:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56003 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/graphics.cpp

index a25d643ccd41648878ecb1524672e169bc72c4ce..d824659040867ba7a25554913fa22cc66ec7f371 100644 (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);
 
 }
 //-----------------------------------------------------------------------------