Browse code

tls: safer destroy_cfg

- tls_destroy_cfg() can now be called safely more then once.

Andrei Pelinescu-Onciul authored on 20/05/2010 14:18:16
Showing 1 changed files
... ...
@@ -128,6 +128,7 @@ void tls_destroy_cfg(void)
128 128
 	if (tls_cfg_lock) {
129 129
 		lock_destroy(tls_cfg_lock);
130 130
 		lock_dealloc(tls_cfg_lock);
131
+		tls_cfg_lock = 0;
131 132
 	}
132 133
 
133 134
 	if (tls_cfg) {
... ...
@@ -138,6 +139,7 @@ void tls_destroy_cfg(void)
138 139
 		}
139 140
 		
140 141
 		shm_free(tls_cfg);
142
+		tls_cfg = 0;
141 143
 	}
142 144
 }
143 145