celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject svn commit: r1623907 - /celix/trunk/framework/private/src/framework.c
Date Wed, 10 Sep 2014 05:42:44 GMT
Author: bpetri
Date: Wed Sep 10 05:42:44 2014
New Revision: 1623907

URL: http://svn.apache.org/r1623907
Log:
CELIX-146

replaced some more printf-calls with fw_log-calls


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=1623907&r1=1623906&r2=1623907&view=diff
==============================================================================
--- celix/trunk/framework/private/src/framework.c (original)
+++ celix/trunk/framework/private/src/framework.c Wed Sep 10 05:42:44 2014
@@ -1971,14 +1971,18 @@ celix_status_t framework_waitForStop(fra
 
 static void *framework_shutdown(void *framework) {
 	framework_pt fw = (framework_pt) framework;
-	hash_map_iterator_pt iterator;
+	hash_map_values_pt values = NULL;
+    bundle_pt **installedBundleArray;
+    unsigned int size;
 	int err;
+    int i;
 
 	fw_log(fw->logger, OSGI_FRAMEWORK_LOG_INFO, "FRAMEWORK: Shutdown");
+    values = hashMapValues_create(fw->installedBundleMap);
+    hashMapValues_toArray(values, (void*) &installedBundleArray, &size);
 
-	iterator = hashMapIterator_create(fw->installedBundleMap);
-	while (hashMapIterator_hasNext(iterator)) {
-		bundle_pt bundle = (bundle_pt) hashMapIterator_nextValue(iterator);
+    for(i = 0; i < size; i++) {
+	    bundle_pt bundle = (bundle_pt) installedBundleArray[i];
 		bundle_state_e state;
 		bundle_getState(bundle, &state);
 		if (state == OSGI_FRAMEWORK_BUNDLE_ACTIVE || state == OSGI_FRAMEWORK_BUNDLE_STARTING) {
@@ -1990,7 +1994,6 @@ static void *framework_shutdown(void *fr
 			fw_stopBundle(fw, bundle, 0);
 		}
 	}
-	hashMapIterator_destroy(iterator);
 
 	err = celixThreadMutex_lock(&fw->mutex);
 	if (err != 0) {



Mime
View raw message