From 138bd452800ab18cd1aacd81dabf3e32c320deba Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Thu, 12 Aug 2010 12:35:23 +0000 Subject: [PATCH] CID 908 and 909 : Memory leaks. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38047 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/launchbox/IconButton.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apps/launchbox/IconButton.cpp b/src/apps/launchbox/IconButton.cpp index 810003f4ab..04871ca623 100644 --- a/src/apps/launchbox/IconButton.cpp +++ b/src/apps/launchbox/IconButton.cpp @@ -461,9 +461,9 @@ IconButton::SetIcon(const unsigned char* bitsFromQuickRes, // colorspace needs conversion BBitmap* bitmap = new(nothrow) BBitmap(quickResBitmap->Bounds(), B_RGB32, true); if (bitmap && bitmap->IsValid()) { - BView* helper = new BView(bitmap->Bounds(), "helper", - B_FOLLOW_NONE, B_WILL_DRAW); if (bitmap->Lock()) { + BView* helper = new BView(bitmap->Bounds(), "helper", + B_FOLLOW_NONE, B_WILL_DRAW); bitmap->AddChild(helper); helper->SetHighColor(ui_color(B_PANEL_BACKGROUND_COLOR)); helper->FillRect(helper->Bounds()); @@ -630,9 +630,9 @@ IconButton::_ConvertToRGB32(const BBitmap* bitmap) const B_BITMAP_ACCEPTS_VIEWS, B_RGBA32); if (convertedBitmap && convertedBitmap->IsValid()) { memset(convertedBitmap->Bits(), 0, convertedBitmap->BitsLength()); - BView* helper = new BView(bitmap->Bounds(), "helper", - B_FOLLOW_NONE, B_WILL_DRAW); if (convertedBitmap->Lock()) { + BView* helper = new BView(bitmap->Bounds(), "helper", + B_FOLLOW_NONE, B_WILL_DRAW); convertedBitmap->AddChild(helper); helper->SetDrawingMode(B_OP_OVER); helper->DrawBitmap(bitmap, BPoint(0.0, 0.0));