registrar: Actually checks if the app is running before asking it to quit, iterates until finding a valid app.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38899 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2010-10-08 20:06:51 +00:00
parent fcdc5be4a6
commit 39eb6571be

View File

@ -1456,11 +1456,16 @@ ShutdownProcess::_QuitApps(AppInfoList& list, bool systemApps)
char appName[B_FILE_NAME_LENGTH];
{
BAutolock _(fWorkerLock);
if (!list.IsEmpty()) {
while (!list.IsEmpty()) {
RosterAppInfo* info = *list.It();
team = info->team;
port = info->port;
strcpy(appName, info->ref.name);
if (info->IsRunning())
break;
list.RemoveInfo(info);
delete info;
}
}