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