Skip to content

Commit

Permalink
CELIX-404: Fix for crash with inspect command
Browse files Browse the repository at this point in the history
  • Loading branch information
ErjanAltena committed Feb 24, 2017
1 parent 6785a38 commit b6c3699
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions framework/private/src/service_registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,12 +607,14 @@ celix_status_t serviceRegistry_getServicesInUse(service_registry_pt registry, bu

hash_map_pt refsMap = hashMap_get(registry->serviceReferences, bundle);

hash_map_iterator_pt iter = hashMapIterator_create(refsMap);
while (hashMapIterator_hasNext(iter)) {
service_reference_pt ref = hashMapIterator_nextValue(iter);
arrayList_add(result, ref);
if(refsMap) {
hash_map_iterator_pt iter = hashMapIterator_create(refsMap);
while (hashMapIterator_hasNext(iter)) {
service_reference_pt ref = hashMapIterator_nextValue(iter);
arrayList_add(result, ref);
}
hashMapIterator_destroy(iter);
}
hashMapIterator_destroy(iter);

//UNLOCK
celixThreadRwlock_unlock(&registry->lock);
Expand Down

0 comments on commit b6c3699

Please sign in to comment.