summaryrefslogtreecommitdiff
path: root/vcl/aqua/source
diff options
context:
space:
mode:
authorBabak Mahbod <bmahbod@openoffice.org>2001-01-25 04:25:03 +0000
committerBabak Mahbod <bmahbod@openoffice.org>2001-01-25 04:25:03 +0000
commita127eb0d4e58c6115c530ae2e9a1048b0660602d (patch)
tree6381205892d84d5772ac0f4e0830d43d9002a76a /vcl/aqua/source
parentd7469aa43bac808a6d7cb5b19651f603b8c95e15 (diff)
Modified APIs to properly release graph port.
Diffstat (limited to 'vcl/aqua/source')
-rw-r--r--vcl/aqua/source/gdi/salbmp.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/vcl/aqua/source/gdi/salbmp.cxx b/vcl/aqua/source/gdi/salbmp.cxx
index 814d3f9dec1e..b5ae8203661d 100644
--- a/vcl/aqua/source/gdi/salbmp.cxx
+++ b/vcl/aqua/source/gdi/salbmp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: salbmp.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: bmahbod $ $Date: 2001-01-24 03:39:58 $
+ * last change: $Author: bmahbod $ $Date: 2001-01-25 05:25:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -286,8 +286,6 @@ BitmapBuffer* SalBitmap::AcquireBuffer( BOOL bReadOnly )
if ( pGraphics->maGraphicsData.mnOSStatus == noErr )
{
- ULONG nBMPScanlineFormat = 0;
-
pBuffer = new BitmapBuffer();
if ( pBuffer != NULL )
@@ -317,9 +315,7 @@ BitmapBuffer* SalBitmap::AcquireBuffer( BOOL bReadOnly )
break;
} // switch
- nBMPScanlineFormat = BMP_SCANLINE_FORMAT( pBuffer->mnFormat );
-
- if ( nBMPScanlineFormat )
+ if ( BMP_SCANLINE_FORMAT( pBuffer->mnFormat ) )
{
GWorldFlags nGWorldFlags = noErr;
@@ -384,11 +380,13 @@ BitmapBuffer* SalBitmap::AcquireBuffer( BOOL bReadOnly )
{
UnlockPortBits( pGraphics->maGraphicsData.mpCGrafPort );
- ReleaseBuffer( pBuffer, TRUE );
+ ReleaseGraphics( pGraphics );
+
+ delete pBuffer;
} // else
} // if
- if ( nBMPScanlineFormat )
+ if ( pGraphics != NULL )
{
UnlockPortBits( pGraphics->maGraphicsData.mpCGrafPort );
} // if
@@ -398,7 +396,10 @@ BitmapBuffer* SalBitmap::AcquireBuffer( BOOL bReadOnly )
// Release the SalGraphics so that others can get a
// handle to it in future GetGraphics() calls
- ReleaseGraphics( pGraphics );
+ if ( pGraphics != NULL )
+ {
+ ReleaseGraphics( pGraphics );
+ } // if
} // if
} // if