celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject svn commit: r1644560 - /celix/trunk/remote_services/topology_manager/private/src/topology_manager.c
Date Thu, 11 Dec 2014 06:06:34 GMT
Author: bpetri
Date: Thu Dec 11 06:06:34 2014
New Revision: 1644560

URL: http://svn.apache.org/r1644560
Log:
CELIX-190: added clean-up for left-over importInterests

Modified:
    celix/trunk/remote_services/topology_manager/private/src/topology_manager.c

Modified: celix/trunk/remote_services/topology_manager/private/src/topology_manager.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/topology_manager/private/src/topology_manager.c?rev=1644560&r1=1644559&r2=1644560&view=diff
==============================================================================
--- celix/trunk/remote_services/topology_manager/private/src/topology_manager.c (original)
+++ celix/trunk/remote_services/topology_manager/private/src/topology_manager.c Thu Dec 11
06:06:34 2014
@@ -113,6 +113,20 @@ celix_status_t topologyManager_destroy(t
 
 	status = celixThreadMutex_lock(&manager->importInterestsLock);
 
+	hash_map_iterator_pt iterator = hashMapIterator_create(manager->importInterests);
+
+	while (hashMapIterator_hasNext(iterator)) {
+		hash_map_entry_pt entry = hashMapIterator_nextEntry(iterator);
+		char* key = (char*) hashMapEntry_getKey(entry);
+		struct import_interest *interest = hashMap_remove(manager->importInterests, key);
+
+		free(key);
+		free(interest);
+
+		hashMapIterator_destroy(iterator);
+		iterator = hashMapIterator_create(manager->importInterests);
+	}
+	hashMapIterator_destroy(iterator);
 	hashMap_destroy(manager->importInterests, false, false);
 
 	status = celixThreadMutex_unlock(&manager->importInterestsLock);



Mime
View raw message