Author: abroekhuis
Date: Mon May 30 10:17:24 2011
New Revision: 1129111

URL: http://svn.apache.org/viewvc?rev=1129111&view=rev
Log:
Added destroy to the service registry

Modified:
    incubator/celix/trunk/celix Default.launch
    incubator/celix/trunk/framework/private/include/service_registry.h
    incubator/celix/trunk/framework/private/src/framework.c
    incubator/celix/trunk/framework/private/src/service_registry.c

Modified: incubator/celix/trunk/celix Default.launch
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/celix%20Default.launch?rev=1129111&r1=1129110&r2=1129111&view=diff
==============================================================================
--- incubator/celix/trunk/celix Default.launch (original)
+++ incubator/celix/trunk/celix Default.launch Mon May 30 10:17:24 2011
@@ -61,7 +61,7 @@
 <intAttribute key="org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_FREELIST" 
value="10000000"/>
 <booleanAttribute 
key="org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_GCCWORK" value="false"/>
 <booleanAttribute 
key="org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_LEAKCHECK" value="true"/>
-<stringAttribute 
key="org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_LEAKRES" value="low"/>
+<stringAttribute 
key="org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_LEAKRES" value="high"/>
 <booleanAttribute 
key="org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_PARTIAL" value="false"/>
 <booleanAttribute 
key="org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_SHOWREACH" 
value="false"/>
 <booleanAttribute 
key="org.eclipse.linuxtools.valgrind.memcheck.MEMCHECK_TRACKORIGINS" 
value="false"/>

Modified: incubator/celix/trunk/framework/private/include/service_registry.h
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/service_registry.h?rev=1129111&r1=1129110&r2=1129111&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/service_registry.h 
(original)
+++ incubator/celix/trunk/framework/private/include/service_registry.h Mon May 
30 10:17:24 2011
@@ -33,6 +33,7 @@
 #include "filter.h"
 
 SERVICE_REGISTRY serviceRegistry_create(FRAMEWORK framework, void 
(*serviceChanged)(FRAMEWORK, SERVICE_EVENT, PROPERTIES));
+celix_status_t serviceRegistry_destroy(SERVICE_REGISTRY registry);
 ARRAY_LIST serviceRegistry_getRegisteredServices(SERVICE_REGISTRY registry, 
BUNDLE bundle);
 SERVICE_REGISTRATION serviceRegistry_registerService(SERVICE_REGISTRY 
registry, BUNDLE bundle, char * serviceName, void * serviceObject, PROPERTIES 
dictionary);
 void serviceRegistry_unregisterService(SERVICE_REGISTRY registry, BUNDLE 
bundle, SERVICE_REGISTRATION registration);

Modified: incubator/celix/trunk/framework/private/src/framework.c
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/framework.c?rev=1129111&r1=1129110&r2=1129111&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/framework.c (original)
+++ incubator/celix/trunk/framework/private/src/framework.c Mon May 30 10:17:24 
2011
@@ -182,6 +182,9 @@ celix_status_t framework_destroy(FRAMEWO
        }
        hashMapIterator_destroy(iterator);
 
+       hashMap_destroy(framework->installRequestMap, false, false);
+
+       serviceRegistry_destroy(framework->registry);
 
        apr_pool_destroy(framework->mp);
 

Modified: incubator/celix/trunk/framework/private/src/service_registry.c
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/service_registry.c?rev=1129111&r1=1129110&r2=1129111&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/service_registry.c (original)
+++ incubator/celix/trunk/framework/private/src/service_registry.c Mon May 30 
10:17:24 2011
@@ -100,6 +100,16 @@ SERVICE_REGISTRY serviceRegistry_create(
        return registry;
 }
 
+celix_status_t serviceRegistry_destroy(SERVICE_REGISTRY registry) {
+    hashMap_destroy(registry->inUseMap, false, false);
+    hashMap_destroy(registry->serviceRegistrations, false, false);
+    pthread_mutex_destroy(&registry->mutex);
+
+    free(registry);
+
+    return CELIX_SUCCESS;
+}
+
 ARRAY_LIST serviceRegistry_getRegisteredServices(SERVICE_REGISTRY registry, 
BUNDLE bundle) {
        ARRAY_LIST regs = (ARRAY_LIST) 
hashMap_get(registry->serviceRegistrations, bundle);
        if (regs != NULL) {


Reply via email to