fixing memory leak

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67904 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2011-06-09 01:24:21 +00:00
parent 9d320a7a84
commit e5062a3130

View File

@@ -179,7 +179,7 @@ void wxBell()
@implementation ModalDialogDelegate @implementation ModalDialogDelegate
- (id)init - (id)init
{ {
[super init]; self = [super init];
sheetFinished = NO; sheetFinished = NO;
resultCode = -1; resultCode = -1;
impl = 0; impl = 0;
@@ -379,7 +379,7 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const
[view lockFocus]; [view lockFocus];
// we use this method as other methods force a repaint, and this method can be // we use this method as other methods force a repaint, and this method can be
// called from OnPaint, even with the window's paint dc as source (see wxHTMLWindow) // called from OnPaint, even with the window's paint dc as source (see wxHTMLWindow)
NSBitmapImageRep *rep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect: [view bounds]] retain]; NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect: [view bounds]];
[view unlockFocus]; [view unlockFocus];
if ( [rep respondsToSelector:@selector(CGImage)] ) if ( [rep respondsToSelector:@selector(CGImage)] )
{ {
@@ -388,8 +388,6 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const
CGRect r = CGRectMake( 0 , 0 , CGImageGetWidth(cgImageRef) , CGImageGetHeight(cgImageRef) ); CGRect r = CGRectMake( 0 , 0 , CGImageGetWidth(cgImageRef) , CGImageGetHeight(cgImageRef) );
// since our context is upside down we dont use CGContextDrawImage // since our context is upside down we dont use CGContextDrawImage
wxMacDrawCGImage( (CGContextRef) bitmap.GetHBITMAP() , &r, cgImageRef ) ; wxMacDrawCGImage( (CGContextRef) bitmap.GetHBITMAP() , &r, cgImageRef ) ;
CGImageRelease(cgImageRef);
cgImageRef = NULL;
} }
else else
{ {