From 88b38f2901adc46faa81ddb79719b81be2be5bf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 16 Nov 2009 18:13:27 +0000 Subject: [PATCH] * Moved loading roster settings to the point after it has been added to the registrar. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34077 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/registrar/TRoster.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/servers/registrar/TRoster.cpp b/src/servers/registrar/TRoster.cpp index c6e542e7f5..a832b90572 100644 --- a/src/servers/registrar/TRoster.cpp +++ b/src/servers/registrar/TRoster.cpp @@ -141,7 +141,6 @@ TRoster::TRoster() fLastToken(0), fShuttingDown(false) { - _LoadRosterSettings(); } @@ -1189,21 +1188,18 @@ TRoster::ClearRecentApps() status_t TRoster::Init() { - status_t error = B_OK; - // check lock initialization if (fLock.Sem() < 0) return fLock.Sem(); // create the info RosterAppInfo* info = new(nothrow) RosterAppInfo; - if (!info) - error = B_NO_MEMORY; + if (info == NULL) + return B_NO_MEMORY; // get the app's ref entry_ref ref; - if (error == B_OK) - error = get_app_ref(&ref); + status_t error = get_app_ref(&ref); // init and add the info if (error == B_OK) { @@ -1215,8 +1211,11 @@ TRoster::Init() error = AddApp(info); } + if (error == B_OK) + _LoadRosterSettings(); + // cleanup on error - if (error != B_OK && info) + if (error != B_OK) delete info; return error;