celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject svn commit: r1634951 - /celix/trunk/remote_services/topology_manager/private/src/topology_manager.c
Date Tue, 28 Oct 2014 19:06:02 GMT
Author: bpetri
Date: Tue Oct 28 19:06:01 2014
New Revision: 1634951

URL: http://svn.apache.org/r1634951
Log:
CELIX-175: remove elements from iterator to prevent another handling when topology manager
is shutdown

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=1634951&r1=1634950&r2=1634951&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 Tue Oct 28
19:06:01 2014
@@ -407,16 +407,21 @@ celix_status_t topologyManager_removeExp
 			hash_map_entry_pt entry = hashMapIterator_nextEntry(iter);
 
 			remote_service_admin_service_pt rsa = hashMapEntry_getKey(entry);
-			array_list_pt exports = hashMapEntry_getValue(entry);
+			array_list_pt exportRegistrations = hashMapEntry_getValue(entry);
 
-			for (int exportsIter = 0; exportsIter < arrayList_size(exports); exportsIter++) {
-				export_registration_pt export = arrayList_get(exports, exportsIter);
+			for (int exportsIter = 0; exportsIter < arrayList_size(exportRegistrations); exportsIter++)
{
+				export_registration_pt export = arrayList_get(exportRegistrations, exportsIter);
 				rsa->exportRegistration_close(export);
 
 				topologyManager_notifyListenersEndpointRemoved(manager, rsa, export);
 			}
-			arrayList_destroy(exports);
-			exports = NULL;
+			arrayList_destroy(exportRegistrations);
+			exportRegistrations = NULL;
+
+			hashMap_remove(exports, rsa);
+			hashMapIterator_destroy(iter);
+			iter = hashMapIterator_create(exports);
+
 		}
 		hashMapIterator_destroy(iter);
 	}



Mime
View raw message