Fix CID-10553:
* avoid possible use of deleted catalog (didn't occur because we currently only have a single type of catalog add-on) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39923 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -878,7 +878,7 @@ MutableLocaleRoster::UnloadCatalog(BCatalogAddOn* catalog)
|
|||||||
status_t res = B_ERROR;
|
status_t res = B_ERROR;
|
||||||
BCatalogAddOn* nextCatalog;
|
BCatalogAddOn* nextCatalog;
|
||||||
|
|
||||||
while (catalog) {
|
while (catalog != NULL) {
|
||||||
nextCatalog = catalog->Next();
|
nextCatalog = catalog->Next();
|
||||||
int32 count = RosterData::Default()->fCatalogAddOnInfos.CountItems();
|
int32 count = RosterData::Default()->fCatalogAddOnInfos.CountItems();
|
||||||
for (int32 i = 0; i < count; ++i) {
|
for (int32 i = 0; i < count; ++i) {
|
||||||
@@ -889,6 +889,7 @@ MutableLocaleRoster::UnloadCatalog(BCatalogAddOn* catalog)
|
|||||||
delete catalog;
|
delete catalog;
|
||||||
info->UnloadIfPossible();
|
info->UnloadIfPossible();
|
||||||
res = B_OK;
|
res = B_OK;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catalog = nextCatalog;
|
catalog = nextCatalog;
|
||||||
|
|||||||
Reference in New Issue
Block a user