From 6e1e87a3c3f96fc9e1f5637a6309e5691f5cae12 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 6 Feb 2021 12:48:32 +0100 Subject: [PATCH] Locale Kit: do not unload catalog add-ons Follow-up to #16670. I have previously changed the locale kit to load all add-ons once at start, but did not notice that it would unload them later on. This can also create race conditions if the locale kit is used from inside load_add_on (as is the case in translation kit add-ons for example). Should fix the remaining problems in #16670 Change-Id: I0e22f8e146abe4fc85d8357ebe178db948fec1cd Reviewed-on: https://review.haiku-os.org/c/haiku/+/3734 Reviewed-by: Adrien Destugues --- src/kits/locale/MutableLocaleRoster.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/kits/locale/MutableLocaleRoster.cpp b/src/kits/locale/MutableLocaleRoster.cpp index f5d42f0e44..30a753db9d 100644 --- a/src/kits/locale/MutableLocaleRoster.cpp +++ b/src/kits/locale/MutableLocaleRoster.cpp @@ -156,7 +156,6 @@ MutableLocaleRoster::CreateCatalog(const char* type, const char* signature, BCatalogData* catalog = info->fCreateFunc(signature, language); if (catalog != NULL) { info->fLoadedCatalogs.AddItem(catalog); - info->UnloadIfPossible(); return catalog; } } @@ -234,7 +233,6 @@ MutableLocaleRoster::LoadCatalog(const entry_ref& catalogOwner, if (catalog != NULL) return catalog; } - info->UnloadIfPossible(); } return NULL; @@ -347,7 +345,6 @@ MutableLocaleRoster::LoadCatalog(const char* signature, /* * unloads the given catalog (or rather: catalog-chain). * Every single catalog of the chain will be deleted automatically. - * Add-ons that have no more current catalogs are unloaded, too. */ status_t MutableLocaleRoster::UnloadCatalog(BCatalogData* catalog) @@ -371,7 +368,6 @@ MutableLocaleRoster::UnloadCatalog(BCatalogData* catalog) if (info->fLoadedCatalogs.HasItem(catalog)) { info->fLoadedCatalogs.RemoveItem(catalog); delete catalog; - info->UnloadIfPossible(); res = B_OK; break; }