celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abroekh...@apache.org
Subject svn commit: r1658700 - /celix/trunk/framework/private/src/framework.c
Date Tue, 10 Feb 2015 12:40:51 GMT
Author: abroekhuis
Date: Tue Feb 10 12:40:51 2015
New Revision: 1658700

URL: http://svn.apache.org/r1658700
Log:
CELIX-218: Fixed library unloading by using the correct handles.

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=1658700&r1=1658699&r2=1658700&view=diff
==============================================================================
--- celix/trunk/framework/private/src/framework.c (original)
+++ celix/trunk/framework/private/src/framework.c Tue Feb 10 12:40:51 2015
@@ -958,7 +958,14 @@ celix_status_t fw_uninstallBundle(framew
     status = CELIX_DO_IF(status, framework_setBundleStateAndNotify(framework, bundle, OSGI_FRAMEWORK_BUNDLE_INSTALLED));
 
     // TODO Unload all libraries for transition to unresolved
-    dlclose(bundle_getHandle(bundle));
+    bundle_revision_pt revision = NULL;
+	array_list_pt handles = NULL;
+	status = CELIX_DO_IF(status, bundleArchive_getCurrentRevision(archive, &revision));
+	status = CELIX_DO_IF(status, bundleRevision_getHandles(revision, &handles));
+	for (int i = arrayList_size(handles) - 1; i >= 0; i--) {
+		void *handle = arrayList_get(handles, i);
+		fw_closeLibrary(handle);
+	}
 
     status = CELIX_DO_IF(status, fw_fireBundleEvent(framework, OSGI_FRAMEWORK_BUNDLE_EVENT_UNRESOLVED,
bundle));
 
@@ -2389,7 +2396,7 @@ static celix_status_t framework_loadLibr
         status = CELIX_DO_IF(status, bundleArchive_getCurrentRevision(archive, &revision));
         status = CELIX_DO_IF(status, bundleRevision_getHandles(revision, &handles));
 
-        arrayList_add(handles, handle);
+        arrayList_add(handles, *handle);
     }
 
     framework_logIfError(framework->logger, status, error, "Could not load library: %s",
libraryPath);



Mime
View raw message