Launhcer: fix crashes adding a catalog
Traversing a container which is modified causes crashes, take a copy during traversal for firePackageStatus. Sentry-Id: FLIGHTGEAR-CJF Sentry-Id: FLIGHTGEAR-CJ5
This commit is contained in:
@@ -133,7 +133,9 @@ public:
|
|||||||
|
|
||||||
void fireRefreshStatus(CatalogRef catalog, Delegate::StatusCode status)
|
void fireRefreshStatus(CatalogRef catalog, Delegate::StatusCode status)
|
||||||
{
|
{
|
||||||
for (auto d : delegates) {
|
// take a copy of delegates since firing this can modify the data
|
||||||
|
const auto currentDelegates = delegates;
|
||||||
|
for (auto d : currentDelegates) {
|
||||||
d->catalogRefreshed(catalog, status);
|
d->catalogRefreshed(catalog, status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user