free() the modelist as it's allocated using malloc. A forgotten printf -> fprintf. minor other stuff.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21452 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -31,7 +31,7 @@
|
|||||||
using BPrivate::AppServerLink;
|
using BPrivate::AppServerLink;
|
||||||
|
|
||||||
|
|
||||||
#define TRACE_WINDOWSCREEN 0
|
//#define TRACE_WINDOWSCREEN 1
|
||||||
#if TRACE_WINDOWSCREEN
|
#if TRACE_WINDOWSCREEN
|
||||||
#define CALLED() printf("%s\n", __PRETTY_FUNCTION__);
|
#define CALLED() printf("%s\n", __PRETTY_FUNCTION__);
|
||||||
#else
|
#else
|
||||||
@@ -669,8 +669,7 @@ BWindowScreen::_InitData(uint32 space, uint32 attributes)
|
|||||||
fAttributes = attributes;
|
fAttributes = attributes;
|
||||||
// TODO: not really used right now, but should probably be known by the app_server
|
// TODO: not really used right now, but should probably be known by the app_server
|
||||||
|
|
||||||
fWorkspaceIndex = current_workspace();
|
fWorkspaceIndex = fDebugWorkspace = current_workspace();
|
||||||
fDebugWorkspace = fWorkspaceIndex > 0 ? fWorkspaceIndex - 1 : 1;
|
|
||||||
fLockState = 0;
|
fLockState = 0;
|
||||||
fAddonImage = -1;
|
fAddonImage = -1;
|
||||||
fWindowState = 0;
|
fWindowState = 0;
|
||||||
@@ -713,10 +712,12 @@ BWindowScreen::_InitData(uint32 space, uint32 attributes)
|
|||||||
if (fDebugSem < B_OK)
|
if (fDebugSem < B_OK)
|
||||||
throw fDebugSem;
|
throw fDebugSem;
|
||||||
|
|
||||||
memcpy(fPalette, screen.ColorMap()->color_list, 256);
|
memcpy(fPalette, screen.ColorMap()->color_list, sizeof(fPalette));
|
||||||
fActivateState = 0;
|
fActivateState = 0;
|
||||||
fWorkState = 1;
|
fWorkState = 1;
|
||||||
|
|
||||||
|
status = B_OK;
|
||||||
|
|
||||||
} catch (std::bad_alloc) {
|
} catch (std::bad_alloc) {
|
||||||
status = B_NO_MEMORY;
|
status = B_NO_MEMORY;
|
||||||
} catch (int error) {
|
} catch (int error) {
|
||||||
@@ -725,7 +726,7 @@ BWindowScreen::_InitData(uint32 space, uint32 attributes)
|
|||||||
status = B_ERROR;
|
status = B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status != B_OK)
|
if (status < B_OK)
|
||||||
_DisposeData();
|
_DisposeData();
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
@@ -754,7 +755,7 @@ BWindowScreen::_DisposeData()
|
|||||||
fDisplayMode = NULL;
|
fDisplayMode = NULL;
|
||||||
delete fOriginalDisplayMode;
|
delete fOriginalDisplayMode;
|
||||||
fOriginalDisplayMode = NULL;
|
fOriginalDisplayMode = NULL;
|
||||||
delete fModeList;
|
free(fModeList);
|
||||||
fModeList = NULL;
|
fModeList = NULL;
|
||||||
fModeCount = 0;
|
fModeCount = 0;
|
||||||
|
|
||||||
@@ -1098,7 +1099,7 @@ BWindowScreen::_AssertDisplayMode(display_mode* displayMode)
|
|||||||
|| currentMode.flags != displayMode->flags) {
|
|| currentMode.flags != displayMode->flags) {
|
||||||
status = screen.SetMode(displayMode);
|
status = screen.SetMode(displayMode);
|
||||||
if (status < B_OK) {
|
if (status < B_OK) {
|
||||||
printf("AssertDisplayMode: Setting mode failed: %s\n", strerror(status));
|
fprintf(stderr, "AssertDisplayMode: Setting mode failed: %s\n", strerror(status));
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user