added cache cleanup code
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 21 Sep 2007 16:12:07 +0000 (16:12 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 21 Sep 2007 16:12:07 +0000 (16:12 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1090 9efc2488-bf62-4759-914b-345cdb29e865

include/opensrf/osrf_cache.h
src/libopensrf/osrf_cache.c
src/libopensrf/osrf_system.c

index 8960801..cf7238d 100644 (file)
@@ -80,3 +80,7 @@ int osrfCacheSetExpire( time_t seconds, char* key, ... );
 
 
 
+/**
+ * Clean up the global cache handles, etc.
+ */
+void osrfCacheCleanup();
index 940af11..6c83633 100644 (file)
@@ -96,4 +96,9 @@ int osrfCacheSetExpire( time_t seconds, char* key, ... ) {
        return -1;
 }
 
+void osrfCacheCleanup() {
+    if(__osrfCache) 
+        mc_free(__osrfCache);
+}
+
 
index 09263b3..92cfaca 100644 (file)
@@ -454,6 +454,7 @@ int osrf_system_disconnect_client( void ) {
 
 int osrf_system_shutdown( void ) {
        osrfConfigCleanup();
+    osrfCacheCleanup();
        osrf_system_disconnect_client();
        osrf_settings_free_host_config(NULL);
        osrfAppSessionCleanup();