BRoster: Fix infinite loop when trying to launch app with missing libraries.
Fixes #14986. Change-Id: I727fde0c475f0684567a46be5af616cad56a9b4c Reviewed-on: https://review.haiku-os.org/c/haiku/+/1738 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
2d181d97e8
commit
6faf979da7
@@ -1872,6 +1872,7 @@ BRoster::_LaunchApp(const char* mimeType, const entry_ref* ref,
|
|||||||
thread_id appThread = -1;
|
thread_id appThread = -1;
|
||||||
port_id appPort = -1;
|
port_id appPort = -1;
|
||||||
uint32 appToken = 0;
|
uint32 appToken = 0;
|
||||||
|
entry_ref hintRef;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
// find the app
|
// find the app
|
||||||
@@ -1881,6 +1882,7 @@ BRoster::_LaunchApp(const char* mimeType, const entry_ref* ref,
|
|||||||
&appFlags, &wasDocument);
|
&appFlags, &wasDocument);
|
||||||
DBG(OUT(" find app: %s (%" B_PRIx32 ") %s \n", strerror(error), error,
|
DBG(OUT(" find app: %s (%" B_PRIx32 ") %s \n", strerror(error), error,
|
||||||
signature));
|
signature));
|
||||||
|
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
@@ -1956,15 +1958,18 @@ BRoster::_LaunchApp(const char* mimeType, const entry_ref* ref,
|
|||||||
_RemovePreRegApp(appToken);
|
_RemovePreRegApp(appToken);
|
||||||
|
|
||||||
if (!wasDocument) {
|
if (!wasDocument) {
|
||||||
|
// Did we already try this?
|
||||||
|
if (appRef == hintRef)
|
||||||
|
break;
|
||||||
|
|
||||||
// Remove app hint if it's this one
|
// Remove app hint if it's this one
|
||||||
BMimeType appType(signature);
|
BMimeType appType(signature);
|
||||||
entry_ref hintRef;
|
|
||||||
|
|
||||||
if (appType.InitCheck() == B_OK
|
if (appType.InitCheck() == B_OK
|
||||||
&& appType.GetAppHint(&hintRef) == B_OK
|
&& appType.GetAppHint(&hintRef) == B_OK
|
||||||
&& appRef == hintRef) {
|
&& appRef == hintRef) {
|
||||||
appType.SetAppHint(NULL);
|
appType.SetAppHint(NULL);
|
||||||
// try again
|
// try again with the app hint removed
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user