From 24039e8e2ca680038a048e6c43c13e6d61e177f9 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 21 Sep 2007 16:12:07 +0000 Subject: [PATCH] added cache cleanup code git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1090 9efc2488-bf62-4759-914b-345cdb29e865 --- include/opensrf/osrf_cache.h | 4 ++++ src/libopensrf/osrf_cache.c | 5 +++++ src/libopensrf/osrf_system.c | 1 + 3 files changed, 10 insertions(+) diff --git a/include/opensrf/osrf_cache.h b/include/opensrf/osrf_cache.h index 8960801..cf7238d 100644 --- a/include/opensrf/osrf_cache.h +++ b/include/opensrf/osrf_cache.h @@ -80,3 +80,7 @@ int osrfCacheSetExpire( time_t seconds, char* key, ... ); +/** + * Clean up the global cache handles, etc. + */ +void osrfCacheCleanup(); diff --git a/src/libopensrf/osrf_cache.c b/src/libopensrf/osrf_cache.c index 940af11..6c83633 100644 --- a/src/libopensrf/osrf_cache.c +++ b/src/libopensrf/osrf_cache.c @@ -96,4 +96,9 @@ int osrfCacheSetExpire( time_t seconds, char* key, ... ) { return -1; } +void osrfCacheCleanup() { + if(__osrfCache) + mc_free(__osrfCache); +} + diff --git a/src/libopensrf/osrf_system.c b/src/libopensrf/osrf_system.c index 09263b3..92cfaca 100644 --- a/src/libopensrf/osrf_system.c +++ b/src/libopensrf/osrf_system.c @@ -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(); -- 2.11.0