You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2020/03/24 17:41:39 UTC

[celix] branch develop updated: Move destruction of serviceRegistry to before destruction of bundles, preventing a use after free situation when dangling service registrations exist

This is an automated email from the ASF dual-hosted git repository.

pnoltes pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/celix.git


The following commit(s) were added to refs/heads/develop by this push:
     new 515f926  Move destruction of serviceRegistry to before destruction of bundles, preventing a use after free situation when dangling service registrations exist
     new 93d3daf  Merge pull request #173 from Oipo/develop
515f926 is described below

commit 515f926529160b09e53df493d91fbad0a37572dc
Author: Michael de Lang <ki...@gmail.com>
AuthorDate: Tue Mar 24 14:22:55 2020 +0100

    Move destruction of serviceRegistry to before destruction of bundles, preventing a use after free situation when dangling service registrations exist
---
 libs/framework/src/framework.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libs/framework/src/framework.c b/libs/framework/src/framework.c
index 06112bf..586c639 100644
--- a/libs/framework/src/framework.c
+++ b/libs/framework/src/framework.c
@@ -298,6 +298,7 @@ celix_status_t framework_destroy(framework_pt framework) {
     //has not been joined yet.
     celixThread_join(framework->shutdown.thread, NULL);
 
+    serviceRegistry_destroy(framework->registry);
 
     celixThreadMutex_lock(&framework->installedBundles.mutex);
     for (int i = 0; i < celix_arrayList_size(framework->installedBundles.entries); ++i) {
@@ -342,12 +343,8 @@ celix_status_t framework_destroy(framework_pt framework) {
     celix_arrayList_destroy(framework->installedBundles.entries);
     celixThreadMutex_destroy(&framework->installedBundles.mutex);
 
-
-
 	hashMap_destroy(framework->installRequestMap, false, false);
 
-	serviceRegistry_destroy(framework->registry);
-
     if (framework->bundleListeners) {
         arrayList_destroy(framework->bundleListeners);
     }