]> git.saurik.com Git - wxWidgets.git/commitdiff
fixing memleak, correcting huge background erase area
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 4 Aug 2004 19:22:22 +0000 (19:22 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 4 Aug 2004 19:22:22 +0000 (19:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28626 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/window.cpp

index fd3367ace18f706e78defadd239bb3a7f80ea160..f9877b75eb04e6cb3a8beee56ee28ebc3dddd3c4 100644 (file)
@@ -1983,7 +1983,8 @@ void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect)
         // right now this is wx' window coordinates, as our native peer does not have borders, this is
         // inset
         OffsetRgn( update , -MacGetLeftBorderSize() , -MacGetTopBorderSize() ) ;
         // right now this is wx' window coordinates, as our native peer does not have borders, this is
         // inset
         OffsetRgn( update , -MacGetLeftBorderSize() , -MacGetTopBorderSize() ) ;
-        m_peer->SetNeedsDisplay( true , update) ;    
+        m_peer->SetNeedsDisplay( true , update) ; 
+        DisposeRgn( update ) ;   
     }
 #else
 /*
     }
 #else
 /*
@@ -2696,11 +2697,10 @@ bool wxWindowMac::MacDoRedraw( WXHRGN updatergnr , long time )
         SetRectRgn( newupdate , origin.x , origin.y , origin.x + point.x , origin.y+point.y ) ;
         SectRgn( newupdate , updatergn , newupdate ) ;
         
         SetRectRgn( newupdate , origin.x , origin.y , origin.x + point.x , origin.y+point.y ) ;
         SectRgn( newupdate , updatergn , newupdate ) ;
         
+        if (!EmptyRgn(newupdate))
         {
             wxWindowDC dc(this);
         {
             wxWindowDC dc(this);
-            if (!EmptyRgn(newupdate))
-                dc.SetClippingRegion(wxRegion(newupdate));
-
+            dc.SetClippingRegion(wxRegion(newupdate));
             wxEraseEvent eevent( GetId(), &dc );
             eevent.SetEventObject( this );
             GetEventHandler()->ProcessEvent( eevent );
             wxEraseEvent eevent( GetId(), &dc );
             eevent.SetEventObject( this );
             GetEventHandler()->ProcessEvent( eevent );