summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2011-05-17 12:45:43 +0200
committerDavid Tardon <dtardon@redhat.com>2011-05-18 06:05:42 +0200
commit9e848f19fdd5f146bfa18a756fe488ccbd71be9c (patch)
tree0817f20da4ff19d16f78dc6a8d6e47ee47a49efc /sfx2
parent8ed7a0e351ef1beee96851e21513abdc168da2ff (diff)
avoid memory leak
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/shutdowniconunx.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx
index d8c33ecbb67a..5e70016d1ff1 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(),