host: don't destroy reference counter

The reference counter should not be destroyed in HostClearMemory()
as the host can be reused directly (without going through Init
function).
pull/230/head
Eric Leblond 13 years ago
parent ca1a70a04b
commit d9eaa0d340

@ -79,6 +79,7 @@ void HostFree(Host *h) {
if (h != NULL) { if (h != NULL) {
HostClearMemory(h); HostClearMemory(h);
SC_ATOMIC_DESTROY(h->use_cnt);
SCMutexDestroy(&h->m); SCMutexDestroy(&h->m);
SCFree(h); SCFree(h);
(void) SC_ATOMIC_SUB(host_memuse, sizeof(Host)); (void) SC_ATOMIC_SUB(host_memuse, sizeof(Host));
@ -112,7 +113,6 @@ void HostClearMemory(Host *h) {
SCFree(h->iprep); SCFree(h->iprep);
h->iprep = NULL; h->iprep = NULL;
} }
SC_ATOMIC_DESTROY(h->use_cnt);
} }
#define HOST_DEFAULT_HASHSIZE 4096 #define HOST_DEFAULT_HASHSIZE 4096

Loading…
Cancel
Save