minor memory leaks in concurrentBufferManager

This commit is contained in:
Sears Russell 2011-04-26 04:17:36 +00:00
parent 1b8357f266
commit f868b03b0a

View file

@ -172,6 +172,7 @@ static void deinitTLS(void *tlsp) {
p->id --; p->id --;
} }
ch->lru->insert(ch->lru, tls->p); // TODO: put it into the LRU end instead of the MRU end, so the memory is treated as stale. ch->lru->insert(ch->lru, tls->p); // TODO: put it into the LRU end instead of the MRU end, so the memory is treated as stale.
free(tls);
} }
static inline stasis_buffer_concurrent_hash_tls_t * populateTLS(stasis_buffer_manager_t* bm) { static inline stasis_buffer_concurrent_hash_tls_t * populateTLS(stasis_buffer_manager_t* bm) {
stasis_buffer_concurrent_hash_t *ch = bm->impl; stasis_buffer_concurrent_hash_t *ch = bm->impl;
@ -378,7 +379,9 @@ static void chBufDeinitHelper(stasis_buffer_manager_t * bm, int crash) {
hashtable_deinit(ch->ht); hashtable_deinit(ch->ht);
ch->lru->deinit(ch->lru); ch->lru->deinit(ch->lru);
stasis_buffer_pool_deinit(ch->buffer_pool); stasis_buffer_pool_deinit(ch->buffer_pool);
ch->page_handle->close(ch->page_handle);
free(ch); free(ch);
free(bm);
} }
static void chSimulateBufferManagerCrash(stasis_buffer_manager_t *bm) { static void chSimulateBufferManagerCrash(stasis_buffer_manager_t *bm) {
chBufDeinitHelper(bm, 1); chBufDeinitHelper(bm, 1);