celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject svn commit: r1646638 - /celix/trunk/framework/private/src/framework.c
Date Fri, 19 Dec 2014 07:11:22 GMT
Author: bpetri
Date: Fri Dec 19 07:11:22 2014
New Revision: 1646638

URL: http://svn.apache.org/r1646638
Log:
added some missing cleanup while uninstalling bundle

Modified:
    celix/trunk/framework/private/src/framework.c

Modified: celix/trunk/framework/private/src/framework.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/src/framework.c?rev=1646638&r1=1646637&r2=1646638&view=diff
==============================================================================
--- celix/trunk/framework/private/src/framework.c (original)
+++ celix/trunk/framework/private/src/framework.c Fri Dec 19 07:11:22 2014
@@ -236,6 +236,7 @@ celix_status_t framework_destroy(framewo
             bundle_getContext(framework->bundle, &context);
             bundleContext_destroy(context);
 		}
+
 		if (bundle_getArchive(bundle, &archive) == CELIX_SUCCESS) {
 			bundleArchive_destroy(archive);
 		}
@@ -926,9 +927,13 @@ celix_status_t fw_uninstallBundle(framew
     status = CELIX_DO_IF(status, bundle_getArchive(bundle, &archive));
     status = CELIX_DO_IF(status, bundleArchive_getLocation(archive, &location));
     if (status == CELIX_SUCCESS) {
-        // TODO sync issues?
-        target = (bundle_pt) hashMap_remove(framework->installedBundleMap, location);
 
+    	// TODO sync issues?
+        hash_map_entry_pt entry = hashMap_getEntry(framework->installedBundleMap, location);
+        char* entryLocation = hashMapEntry_getKey(entry);
+
+        target = (bundle_pt) hashMap_remove(framework->installedBundleMap, location);
+        free(entryLocation);
         if (target != NULL) {
             status = CELIX_DO_IF(status, bundle_setPersistentStateUninstalled(target));
             // fw_rememberUninstalledBundle(framework, target);
@@ -965,6 +970,7 @@ celix_status_t fw_uninstallBundle(framew
             if (refreshStatus != CELIX_SUCCESS) {
                 printf("Could not refresh bundle");
             } else {
+                bundleArchive_destroy(archive);
                 status = CELIX_DO_IF(status, bundle_destroy(bundle));
             }
 



Mime
View raw message