pict generation code takes into account mask, getting rid of a memory leak
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17561 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -272,14 +272,19 @@ PicHandle wxMacCreatePict(GWorldPtr wp, GWorldPtr mask)
|
||||
|
||||
SetGWorld( wp , NULL ) ;
|
||||
Rect portRect ;
|
||||
GetPortBounds( wp , &portRect ) ;
|
||||
|
||||
if ( clipRgn )
|
||||
portRect = (**clipRgn).rgnBBox ;
|
||||
else
|
||||
GetPortBounds( wp , &portRect ) ;
|
||||
pict = OpenPicture(&portRect);
|
||||
if(pict)
|
||||
{
|
||||
RGBForeColor( &black ) ;
|
||||
RGBBackColor( &white ) ;
|
||||
|
||||
|
||||
if ( clipRgn )
|
||||
SetClip( clipRgn ) ;
|
||||
|
||||
LockPixels( GetGWorldPixMap( wp ) ) ;
|
||||
CopyBits(GetPortBitMapForCopyBits(wp),
|
||||
GetPortBitMapForCopyBits(wp),
|
||||
@@ -290,6 +295,8 @@ PicHandle wxMacCreatePict(GWorldPtr wp, GWorldPtr mask)
|
||||
ClosePicture();
|
||||
}
|
||||
SetGWorld( origPort , origDev ) ;
|
||||
if ( clipRgn )
|
||||
DisposeRgn( clipRgn ) ;
|
||||
return pict;
|
||||
}
|
||||
|
||||
|
@@ -272,14 +272,19 @@ PicHandle wxMacCreatePict(GWorldPtr wp, GWorldPtr mask)
|
||||
|
||||
SetGWorld( wp , NULL ) ;
|
||||
Rect portRect ;
|
||||
GetPortBounds( wp , &portRect ) ;
|
||||
|
||||
if ( clipRgn )
|
||||
portRect = (**clipRgn).rgnBBox ;
|
||||
else
|
||||
GetPortBounds( wp , &portRect ) ;
|
||||
pict = OpenPicture(&portRect);
|
||||
if(pict)
|
||||
{
|
||||
RGBForeColor( &black ) ;
|
||||
RGBBackColor( &white ) ;
|
||||
|
||||
|
||||
if ( clipRgn )
|
||||
SetClip( clipRgn ) ;
|
||||
|
||||
LockPixels( GetGWorldPixMap( wp ) ) ;
|
||||
CopyBits(GetPortBitMapForCopyBits(wp),
|
||||
GetPortBitMapForCopyBits(wp),
|
||||
@@ -290,6 +295,8 @@ PicHandle wxMacCreatePict(GWorldPtr wp, GWorldPtr mask)
|
||||
ClosePicture();
|
||||
}
|
||||
SetGWorld( origPort , origDev ) ;
|
||||
if ( clipRgn )
|
||||
DisposeRgn( clipRgn ) ;
|
||||
return pict;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user