diff options
author | David Tardon <dtardon@redhat.com> | 2011-05-17 12:45:43 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2011-05-18 06:05:42 +0200 |
commit | 4e745ff02fc0b9779786a95149d0ca5ffe5b0ed9 (patch) | |
tree | f75007c93744e4d54ab1f6226c6e433f94be63ed | |
parent | c6d929b9802b55d420e4e5b55e6044bd2bf33c47 (diff) |
avoid memory leak
-rw-r--r-- | sfx2/source/appl/shutdowniconunx.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx index d8c33ecbb6..5e70016d1f 100644 --- a/sfx2/source/appl/shutdowniconunx.cxx +++ b/sfx2/source/appl/shutdowniconunx.cxx @@ -90,10 +90,10 @@ static GdkPixbuf * ResIdToPixbuf( sal_uInt16 nResId ) Bitmap pInSalBitmap = aIcon.GetBitmap(); AlphaMask pInSalAlpha = aIcon.GetAlpha(); - BitmapReadAccess* pSalBitmap = pInSalBitmap.AcquireReadAccess(); - BitmapReadAccess* pSalAlpha = pInSalAlpha.AcquireReadAccess(); + Bitmap::ScopedReadAccess pSalBitmap(pInSalBitmap); + AlphaMask::ScopedReadAccess pSalAlpha(pInSalAlpha); - g_return_val_if_fail( pSalBitmap != NULL, NULL ); + g_return_val_if_fail( pSalBitmap, NULL ); Size aSize( pSalBitmap->Width(), pSalBitmap->Height() ); if (pSalAlpha) @@ -123,10 +123,6 @@ static GdkPixbuf * ResIdToPixbuf( sal_uInt16 nResId ) } } - pInSalBitmap.ReleaseAccess( pSalBitmap ); - if( pSalAlpha ) - pInSalAlpha.ReleaseAccess( pSalAlpha ); - return gdk_pixbuf_new_from_data( pPixbufData, GDK_COLORSPACE_RGB, sal_True, 8, aSize.Width(), aSize.Height(), |