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-77: fixed memory leak, added missing ungetService
Date Fri, 15 Jan 2016 07:14:46 GMT
Repository: celix
Updated Branches:
  refs/heads/develop 5834d633c -> 7d10d6e97


CELIX-77: fixed memory leak, added missing ungetService


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

Branch: refs/heads/develop
Commit: 7d10d6e97ac9b911b1fb1e9d26a116cfd3695a04
Parents: 5834d63
Author: Bjoern Petri <bpetri@apache.org>
Authored: Fri Jan 15 08:14:17 2016 +0100
Committer: Bjoern Petri <bpetri@apache.org>
Committed: Fri Jan 15 08:14:17 2016 +0100

----------------------------------------------------------------------
 config_admin/config_admin_tst/config_admin_test.cpp        | 4 ++++
 config_admin/service/private/src/managed_service_tracker.c | 4 ++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/7d10d6e9/config_admin/config_admin_tst/config_admin_test.cpp
----------------------------------------------------------------------
diff --git a/config_admin/config_admin_tst/config_admin_test.cpp b/config_admin/config_admin_tst/config_admin_test.cpp
index acb6359..f75cc3a 100644
--- a/config_admin/config_admin_tst/config_admin_test.cpp
+++ b/config_admin/config_admin_tst/config_admin_test.cpp
@@ -94,6 +94,10 @@ tst2_service_pt test2Serv = NULL;
 		rc = bundleContext_ungetService(context, testRef, NULL);
         CHECK_EQUAL(CELIX_SUCCESS, rc);
 
+        // check whether this is necessary
+        rc = bundleContext_ungetService(context, testRef, NULL);
+        CHECK_EQUAL(CELIX_SUCCESS, rc);
+
         rc = bundleContext_ungetServiceReference(context, testRef);
         CHECK_EQUAL(CELIX_SUCCESS, rc);
 

http://git-wip-us.apache.org/repos/asf/celix/blob/7d10d6e9/config_admin/service/private/src/managed_service_tracker.c
----------------------------------------------------------------------
diff --git a/config_admin/service/private/src/managed_service_tracker.c b/config_admin/service/private/src/managed_service_tracker.c
index 642f1aa..e723f29 100644
--- a/config_admin/service/private/src/managed_service_tracker.c
+++ b/config_admin/service/private/src/managed_service_tracker.c
@@ -182,6 +182,10 @@ celix_status_t managedServiceTracker_destroy(bundle_context_pt context,
managed_
 	updatedThreadPool_destroy(mgServTr->updatedThreadPool);
 	celixThreadMutex_destroy(&mgServTr->managedServicesReferencesMutex);
 	serviceTracker_destroy(tracker);
+
+	hashMap_destroy(mgServTr->managedServices, true, true);
+	hashMap_destroy(mgServTr->managedServicesReferences, true, true);
+
     free(mgServTr);
 
 	return CELIX_SUCCESS;


Mime
View raw message