Errors in Desktop::Init() and Desktop::Run() are now taken into account correctly.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17233 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-04-25 20:18:01 +00:00
parent 6d5488e18a
commit 583b05be46
1 changed files with 9 additions and 3 deletions

View File

@ -189,10 +189,16 @@ AppServer::_CreateDesktop(uid_t userID)
try {
desktop = new Desktop(userID);
desktop->Init();
desktop->Run();
status_t status = desktop->Init();
if (status == B_OK) {
if (!desktop->Run())
status = B_ERROR;
}
if (status == B_OK && !fDesktops.AddItem(desktop))
status = B_NO_MEMORY;
if (!fDesktops.AddItem(desktop)) {
if (status < B_OK) {
fprintf(stderr, "Cannot initialize Desktop object: %s\n", strerror(status));
delete desktop;
return NULL;
}