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:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user