celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject celix git commit: CELIX-190: fix memory leak when removing service
Date Wed, 18 Nov 2015 12:23:30 GMT
Repository: celix
Updated Branches:
  refs/heads/develop 4776c571e -> fdeee30ee


CELIX-190: fix memory leak when removing service


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/fdeee30e
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/fdeee30e
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/fdeee30e

Branch: refs/heads/develop
Commit: fdeee30ee34a27ad5a617b1041606afd659e1825
Parents: 4776c57
Author: Bjoern Petri <bpetri@apache.org>
Authored: Wed Nov 18 13:23:06 2015 +0100
Committer: Bjoern Petri <bpetri@apache.org>
Committed: Wed Nov 18 13:23:06 2015 +0100

----------------------------------------------------------------------
 .../private/src/remote_service_admin_impl.c                    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/fdeee30e/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
b/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
index ee50c83..c6e9353 100644
--- a/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
+++ b/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
@@ -465,7 +465,11 @@ celix_status_t remoteServiceAdmin_removeExportedService(export_registration_pt
r
 
     celixThreadMutex_lock(&admin->exportedServicesLock);
 
-    hashMap_remove(admin->exportedServices, registration->reference);
+    array_list_pt registrations = (array_list_pt) hashMap_remove(admin->exportedServices,
registration->reference);
+
+    if (registrations != NULL) {
+    	arrayList_destroy(registrations);
+    }
 
     celixThreadMutex_unlock(&admin->exportedServicesLock);
 


Mime
View raw message