From 4e15eaf779613573d45ad0dc6e97dec40123cb52 Mon Sep 17 00:00:00 2001 From: PengZheng Date: Sun, 24 Sep 2023 18:20:08 +0800 Subject: [PATCH] Revert 6bb8de5 to avoid breaking test_cxx_remote_services_integration. --- libs/framework/src/framework.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/framework/src/framework.c b/libs/framework/src/framework.c index fc61a53b4..88e2224e1 100644 --- a/libs/framework/src/framework.c +++ b/libs/framework/src/framework.c @@ -1113,6 +1113,14 @@ static void* framework_shutdown(void *framework) { celixThreadMutex_unlock(&fw->installedBundles.mutex); size = celix_arrayList_size(stopEntries); + for (int i = size-1; i >= 0; --i) { //note loop in reverse order -> stop later installed bundle first + celix_framework_bundle_entry_t *entry = celix_arrayList_get(stopEntries, i); + + bundle_state_e state = celix_bundle_getState(entry->bnd); + if (state == CELIX_BUNDLE_STATE_ACTIVE || state == CELIX_BUNDLE_STATE_STARTING) { + celix_framework_stopBundleEntry(fw, entry); + } + } for (int i = size-1; i >= 0; --i) { //note loop in reverse order -> uninstall later installed bundle first celix_framework_bundle_entry_t *entry = celix_arrayList_get(stopEntries, i); celix_framework_uninstallBundleEntry(fw, entry, false);