Use the BApplication constructor that returns an error code instead of the one that just exit()s on error, so that we can at least print the error.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10728 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
#include "Debug.h"
|
#include "Debug.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
@@ -31,9 +34,11 @@ static const bigtime_t kRosterSanityEventInterval = 1000000LL;
|
|||||||
|
|
||||||
// constructor
|
// constructor
|
||||||
/*! \brief Creates the registrar application class.
|
/*! \brief Creates the registrar application class.
|
||||||
|
\param error Passed to the BApplication constructor for returning an
|
||||||
|
error code.
|
||||||
*/
|
*/
|
||||||
Registrar::Registrar()
|
Registrar::Registrar(status_t *error)
|
||||||
: BApplication(kRegistrarSignature),
|
: BApplication(kRegistrarSignature, error),
|
||||||
fRoster(NULL),
|
fRoster(NULL),
|
||||||
fClipboardHandler(NULL),
|
fClipboardHandler(NULL),
|
||||||
fMIMEManager(NULL),
|
fMIMEManager(NULL),
|
||||||
@@ -272,14 +277,25 @@ int
|
|||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
FUNCTION_START();
|
FUNCTION_START();
|
||||||
|
|
||||||
// rename the main thread
|
// rename the main thread
|
||||||
rename_thread(find_thread(NULL), kRosterThreadName);
|
rename_thread(find_thread(NULL), kRosterThreadName);
|
||||||
|
|
||||||
// create and run the registrar application
|
// create and run the registrar application
|
||||||
Registrar *app = new Registrar();
|
status_t error;
|
||||||
|
Registrar *app = new Registrar(&error);
|
||||||
|
if (error != B_OK) {
|
||||||
|
fprintf(stderr, "Failed to create the BApplication: %s\n",
|
||||||
|
strerror(error));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
PRINT(("app->Run()...\n"));
|
PRINT(("app->Run()...\n"));
|
||||||
app->Run();
|
app->Run();
|
||||||
|
|
||||||
PRINT(("delete app...\n"));
|
PRINT(("delete app...\n"));
|
||||||
delete app;
|
delete app;
|
||||||
|
|
||||||
FUNCTION_END();
|
FUNCTION_END();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace BPrivate {
|
|||||||
|
|
||||||
class Registrar : public BApplication {
|
class Registrar : public BApplication {
|
||||||
public:
|
public:
|
||||||
Registrar();
|
Registrar(status_t *error);
|
||||||
virtual ~Registrar();
|
virtual ~Registrar();
|
||||||
|
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
|
|||||||
Reference in New Issue
Block a user