CreateBitmap(): Fail if it can not allocate bitmaps.
In init_interface_kit(), check the return value of MenuPrivate::CreateBitmaps() and fail on error. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31964 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -954,11 +954,15 @@ _init_interface_kit_()
|
||||
_init_global_fonts_();
|
||||
|
||||
BPrivate::gWidthBuffer = new BPrivate::WidthBuffer;
|
||||
BPrivate::MenuPrivate::CreateBitmaps();
|
||||
status = BPrivate::MenuPrivate::CreateBitmaps();
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
_menu_info_ptr_ = &BMenu::sMenuInfo;
|
||||
|
||||
status = get_menu_info(&BMenu::sMenuInfo);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
general_info.background_color = ui_color(B_PANEL_BACKGROUND_COLOR);
|
||||
general_info.mark_color.set_to(0, 0, 0);
|
||||
|
||||
@@ -196,11 +196,14 @@ MenuPrivate::CreateBitmaps()
|
||||
{
|
||||
BRect smallRect(0, 0, 16, 10);
|
||||
BRect largeRect(0, 0, 21, 10);
|
||||
|
||||
try {
|
||||
gMenuItemAlt = new BBitmap(smallRect, B_CMAP8);
|
||||
gMenuItemControl = new BBitmap(smallRect, B_CMAP8);
|
||||
gMenuItemOption = new BBitmap(smallRect, B_CMAP8);
|
||||
gMenuItemShift = new BBitmap(largeRect, B_CMAP8);
|
||||
} catch (...) {
|
||||
return B_NO_MEMORY;
|
||||
}
|
||||
|
||||
gMenuItemAlt->ImportBits(kAltBits, sizeof(kAltBits),
|
||||
17, 0, B_CMAP8);
|
||||
|
||||
Reference in New Issue
Block a user