From baa57d6dd854e8fc18a8a6bada3b7a763c6beeb3 Mon Sep 17 00:00:00 2001
From: Murai Takashi <tmurai01@gmail.com>
Date: Sat, 24 Dec 2016 06:19:18 +0900
Subject: [PATCH 39/39] IconButton.cpp: fix memory leak.
---
src/kits/shared/IconButton.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/kits/shared/IconButton.cpp b/src/kits/shared/IconButton.cpp
index 0000f1d..bcfb58a 100644
a
|
b
|
BIconButton::SetIcon(const unsigned char* bitsFromQuickRes,
|
448 | 448 | BBitmap* bitmap = new(std::nothrow) BBitmap( |
449 | 449 | quickResBitmap->Bounds(), B_RGB32, true); |
450 | 450 | if (bitmap && bitmap->IsValid()) { |
451 | | BView* helper = new BView(bitmap->Bounds(), "helper", |
452 | | B_FOLLOW_NONE, B_WILL_DRAW); |
453 | 451 | if (bitmap->Lock()) { |
| 452 | BView* helper = new BView(bitmap->Bounds(), "helper", |
| 453 | B_FOLLOW_NONE, B_WILL_DRAW); |
454 | 454 | bitmap->AddChild(helper); |
455 | 455 | helper->SetHighColor(ui_color(B_PANEL_BACKGROUND_COLOR)); |
456 | 456 | helper->FillRect(helper->Bounds()); |
… |
… |
BIconButton::_ConvertToRGB32(const BBitmap* bitmap) const
|
664 | 664 | B_BITMAP_ACCEPTS_VIEWS, B_RGBA32); |
665 | 665 | if (convertedBitmap && convertedBitmap->IsValid()) { |
666 | 666 | memset(convertedBitmap->Bits(), 0, convertedBitmap->BitsLength()); |
667 | | BView* helper = new BView(bitmap->Bounds(), "helper", |
668 | | B_FOLLOW_NONE, B_WILL_DRAW); |
669 | 667 | if (convertedBitmap->Lock()) { |
| 668 | BView* helper = new BView(bitmap->Bounds(), "helper", |
| 669 | B_FOLLOW_NONE, B_WILL_DRAW); |
670 | 670 | convertedBitmap->AddChild(helper); |
671 | 671 | helper->SetDrawingMode(B_OP_OVER); |
672 | 672 | helper->DrawBitmap(bitmap, BPoint(0.0, 0.0)); |