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
|
// colorspace needs conversion
|
||||||
BBitmap* bitmap = new(nothrow) BBitmap(quickResBitmap->Bounds(), B_RGB32, true);
|
BBitmap* bitmap = new(nothrow) BBitmap(quickResBitmap->Bounds(), B_RGB32, true);
|
||||||
if (bitmap && bitmap->IsValid()) {
|
if (bitmap && bitmap->IsValid()) {
|
||||||
BView* helper = new BView(bitmap->Bounds(), "helper",
|
|
||||||
B_FOLLOW_NONE, B_WILL_DRAW);
|
|
||||||
if (bitmap->Lock()) {
|
if (bitmap->Lock()) {
|
||||||
|
BView* helper = new BView(bitmap->Bounds(), "helper",
|
||||||
|
B_FOLLOW_NONE, B_WILL_DRAW);
|
||||||
bitmap->AddChild(helper);
|
bitmap->AddChild(helper);
|
||||||
helper->SetHighColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
helper->SetHighColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
helper->FillRect(helper->Bounds());
|
helper->FillRect(helper->Bounds());
|
||||||
|
@ -630,9 +630,9 @@ IconButton::_ConvertToRGB32(const BBitmap* bitmap) const
|
||||||
B_BITMAP_ACCEPTS_VIEWS, B_RGBA32);
|
B_BITMAP_ACCEPTS_VIEWS, B_RGBA32);
|
||||||
if (convertedBitmap && convertedBitmap->IsValid()) {
|
if (convertedBitmap && convertedBitmap->IsValid()) {
|
||||||
memset(convertedBitmap->Bits(), 0, convertedBitmap->BitsLength());
|
memset(convertedBitmap->Bits(), 0, convertedBitmap->BitsLength());
|
||||||
BView* helper = new BView(bitmap->Bounds(), "helper",
|
|
||||||
B_FOLLOW_NONE, B_WILL_DRAW);
|
|
||||||
if (convertedBitmap->Lock()) {
|
if (convertedBitmap->Lock()) {
|
||||||
|
BView* helper = new BView(bitmap->Bounds(), "helper",
|
||||||
|
B_FOLLOW_NONE, B_WILL_DRAW);
|
||||||
convertedBitmap->AddChild(helper);
|
convertedBitmap->AddChild(helper);
|
||||||
helper->SetDrawingMode(B_OP_OVER);
|
helper->SetDrawingMode(B_OP_OVER);
|
||||||
helper->DrawBitmap(bitmap, BPoint(0.0, 0.0));
|
helper->DrawBitmap(bitmap, BPoint(0.0, 0.0));
|
||||||
|
|
Loading…
Reference in New Issue