celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject svn commit: r1640682 - in /celix/trunk/deployment_admin/private: include/deployment_admin.h include/deployment_package.h src/deployment_admin.c src/deployment_admin_activator.c
Date Thu, 20 Nov 2014 06:00:57 GMT
Author: bpetri
Date: Thu Nov 20 06:00:57 2014
New Revision: 1640682

URL: http://svn.apache.org/r1640682
Log:
CELIX-186: Fixed minor memory leak

Modified:
    celix/trunk/deployment_admin/private/include/deployment_admin.h
    celix/trunk/deployment_admin/private/include/deployment_package.h
    celix/trunk/deployment_admin/private/src/deployment_admin.c
    celix/trunk/deployment_admin/private/src/deployment_admin_activator.c

Modified: celix/trunk/deployment_admin/private/include/deployment_admin.h
URL: http://svn.apache.org/viewvc/celix/trunk/deployment_admin/private/include/deployment_admin.h?rev=1640682&r1=1640681&r2=1640682&view=diff
==============================================================================
--- celix/trunk/deployment_admin/private/include/deployment_admin.h (original)
+++ celix/trunk/deployment_admin/private/include/deployment_admin.h Thu Nov 20 06:00:57 2014
@@ -53,5 +53,6 @@ typedef enum {
 } DEPLOYMENT_ADMIN_AUDIT_EVENT;
 
 celix_status_t deploymentAdmin_create(apr_pool_t *pool, bundle_context_pt context, deployment_admin_pt
*admin);
+celix_status_t deploymentAdmin_destroy(deployment_admin_pt admin);
 
 #endif /* DEPLOYMENT_ADMIN_H_ */

Modified: celix/trunk/deployment_admin/private/include/deployment_package.h
URL: http://svn.apache.org/viewvc/celix/trunk/deployment_admin/private/include/deployment_package.h?rev=1640682&r1=1640681&r2=1640682&view=diff
==============================================================================
--- celix/trunk/deployment_admin/private/include/deployment_package.h (original)
+++ celix/trunk/deployment_admin/private/include/deployment_package.h Thu Nov 20 06:00:57
2014
@@ -67,6 +67,7 @@ struct deployment_package {
 typedef struct deployment_package *deployment_package_pt;
 
 celix_status_t deploymentPackage_create(apr_pool_t *pool, bundle_context_pt context, manifest_pt
manifest, deployment_package_pt *package);
+celix_status_t deploymentPackage_destroy(deployment_package_pt package);
 celix_status_t deploymentPackage_getName(deployment_package_pt package, char **name);
 celix_status_t deploymentPackage_getBundleInfos(deployment_package_pt package, array_list_pt
*infos);
 celix_status_t deploymentPackage_getBundleInfoByName(deployment_package_pt package, char
*name, bundle_info_pt *info);

Modified: celix/trunk/deployment_admin/private/src/deployment_admin.c
URL: http://svn.apache.org/viewvc/celix/trunk/deployment_admin/private/src/deployment_admin.c?rev=1640682&r1=1640681&r2=1640682&view=diff
==============================================================================
--- celix/trunk/deployment_admin/private/src/deployment_admin.c (original)
+++ celix/trunk/deployment_admin/private/src/deployment_admin.c Thu Nov 20 06:00:57 2014
@@ -129,6 +129,20 @@ celix_status_t deploymentAdmin_create(ap
 	return status;
 }
 
+
+
+celix_status_t deploymentAdmin_destroy(deployment_admin_pt admin) {
+	celix_status_t status = CELIX_SUCCESS;
+
+	hashMap_destroy(admin->packages, false, false);
+
+	if (admin->current != NULL) {
+		free(admin->current);
+	}
+
+	return status;
+}
+
 static celix_status_t deploymentAdmin_updateAuditPool(deployment_admin_pt admin, DEPLOYMENT_ADMIN_AUDIT_EVENT
auditEvent) {
 	celix_status_t status = CELIX_SUCCESS;
 

Modified: celix/trunk/deployment_admin/private/src/deployment_admin_activator.c
URL: http://svn.apache.org/viewvc/celix/trunk/deployment_admin/private/src/deployment_admin_activator.c?rev=1640682&r1=1640681&r2=1640682&view=diff
==============================================================================
--- celix/trunk/deployment_admin/private/src/deployment_admin_activator.c (original)
+++ celix/trunk/deployment_admin/private/src/deployment_admin_activator.c Thu Nov 20 06:00:57
2014
@@ -33,12 +33,14 @@ struct activator {
 	deployment_admin_pt admin;
 };
 
+typedef struct activator* activator_pt;
+
 celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	apr_pool_t *parentPool = NULL;
 	apr_pool_t *pool = NULL;
-	struct activator *activator;
+	activator_pt activator = NULL;
 
 	status = bundleContext_getMemoryPool(context, &parentPool);
 	if (status == CELIX_SUCCESS) {
@@ -75,6 +77,11 @@ celix_status_t bundleActivator_stop(void
 
 celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt context) {
 	celix_status_t status = CELIX_SUCCESS;
+
+	activator_pt activator = (activator_pt) userData;
+
+	status = deploymentAdmin_destroy(activator->admin);
+
 	return status;
 }
 



Mime
View raw message