CID 908 and 909 : Memory leaks.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38047 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
eaf26d03ba
commit
138bd45280
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user