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:
parent
2397da28a0
commit
dca399f444
@ -2,6 +2,9 @@
|
||||
|
||||
#include "Debug.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <Application.h>
|
||||
#include <Message.h>
|
||||
#include <OS.h>
|
||||
@ -31,9 +34,11 @@ static const bigtime_t kRosterSanityEventInterval = 1000000LL;
|
||||
|
||||
// constructor
|
||||
/*! \brief Creates the registrar application class.
|
||||
\param error Passed to the BApplication constructor for returning an
|
||||
error code.
|
||||
*/
|
||||
Registrar::Registrar()
|
||||
: BApplication(kRegistrarSignature),
|
||||
Registrar::Registrar(status_t *error)
|
||||
: BApplication(kRegistrarSignature, error),
|
||||
fRoster(NULL),
|
||||
fClipboardHandler(NULL),
|
||||
fMIMEManager(NULL),
|
||||
@ -272,14 +277,25 @@ int
|
||||
main()
|
||||
{
|
||||
FUNCTION_START();
|
||||
|
||||
// rename the main thread
|
||||
rename_thread(find_thread(NULL), kRosterThreadName);
|
||||
|
||||
// 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"));
|
||||
app->Run();
|
||||
|
||||
PRINT(("delete app...\n"));
|
||||
delete app;
|
||||
|
||||
FUNCTION_END();
|
||||
return 0;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ namespace BPrivate {
|
||||
|
||||
class Registrar : public BApplication {
|
||||
public:
|
||||
Registrar();
|
||||
Registrar(status_t *error);
|
||||
virtual ~Registrar();
|
||||
|
||||
virtual void MessageReceived(BMessage *message);
|
||||
|
Loading…
Reference in New Issue
Block a user