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:
parent
95ed6b3c0b
commit
70dc439139
|
@ -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);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue