Check return value also for B_ALREADY_RUNNING, or else we launch the add-on twice.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33014 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jonas Sundström 2009-09-09 01:29:45 +00:00
parent 95ed6b3c0b
commit 70dc439139
1 changed files with 9 additions and 8 deletions

View File

@ -52,17 +52,18 @@ process_refs(entry_ref directory, BMessage* refs, void* reserved)
if (get_ref_for_path(image.name, &addonRef) != B_OK) if (get_ref_for_path(image.name, &addonRef) != B_OK)
return; return;
if (be_roster->Launch(&addonRef, refs) != B_OK) { status = be_roster->Launch(&addonRef, refs);
if (status == B_OK || status == B_ALREADY_RUNNING)
return;
// If launching by entry_ref fails it's probably futile to // If launching by entry_ref fails it's probably futile to
// launch by signature this way, but we can try anyway. // launch by signature this way, but we can try anyway.
app_info appInfo; app_info appInfo;
if (be_roster->GetAppInfo(&addonRef, &appInfo) != B_OK) if (be_roster->GetAppInfo(&addonRef, &appInfo) != B_OK)
return; return;
be_roster->Launch(appInfo.signature, refs); be_roster->Launch(appInfo.signature, refs);
}
} }