don't run the cleanup/shutdown code more than once per process
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 8 Jul 2008 22:16:02 +0000 (22:16 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 8 Jul 2008 22:16:02 +0000 (22:16 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1361 9efc2488-bf62-4759-914b-345cdb29e865

src/libopensrf/osrf_system.c

index d2b8cb0..0e179ac 100644 (file)
@@ -456,13 +456,16 @@ int osrf_system_disconnect_client( void ) {
        return 0;
 }
 
+static int shutdownComplete = 0;
 int osrf_system_shutdown( void ) {
+    if(shutdownComplete) return;
        osrfConfigCleanup();
     osrfCacheCleanup();
        osrf_system_disconnect_client();
        osrf_settings_free_host_config(NULL);
        osrfAppSessionCleanup();
        osrfLogCleanup();
+    shutdownComplete = 1;
        return 1;
 }