Check the BApplication construction error.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13314 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2005-06-28 14:48:26 +00:00
parent 62d011e8ef
commit 7e5f681ff4
2 changed files with 24 additions and 2 deletions

View File

@ -1,5 +1,8 @@
// TestApp.cpp
#include <stdio.h>
#include <string.h>
#include <Autolock.h>
#include <TestApp.h>
@ -27,12 +30,20 @@ BTestHandler::Queue()
// TestApp
static status_t sInitError;
// constructor
BTestApp::BTestApp(const char *signature)
: BApplication(signature),
: BApplication(signature, &sInitError),
fAppThread(B_ERROR),
fHandlers()
{
if (sInitError != B_OK) {
fprintf(stderr, "BTestApp::BTestApp(): Failed to create BApplication: "
"%s\n", strerror(sInitError));
exit(1);
}
CreateTestHandler();
Unlock();
}

View File

@ -1,5 +1,8 @@
// TestApp.cpp
#include <stdio.h>
#include <string.h>
#include <Autolock.h>
#include <TestApp.h>
@ -29,13 +32,21 @@ BTestHandler::Queue()
// TestApp
static status_t sInitError;
// constructor
_EXPORT
BTestApp::BTestApp(const char *signature)
: BApplication(signature),
: BApplication(signature, &sInitError),
fAppThread(B_ERROR),
fHandlers()
{
if (sInitError != B_OK) {
fprintf(stderr, "BTestApp::BTestApp(): Failed to create BApplication: "
"%s\n", strerror(sInitError));
exit(1);
}
CreateTestHandler();
Unlock();
}