Cache: Plug some leaks

This commit is contained in:
Johan Wikman
2016-12-14 13:22:11 +02:00
parent a8a5bafdb6
commit c81394445b
2 changed files with 9 additions and 0 deletions

View File

@ -25,6 +25,14 @@ LRUStorage::LRUStorage(Storage* pstorage, size_t max_count, size_t max_size)
LRUStorage::~LRUStorage()
{
Node* pnode = phead_;
while (phead_)
{
free_node(phead_); // Adjusts phead_
}
delete pstorage_;
}
cache_result_t LRUStorage::get_key(const char* zdefault_db,

View File

@ -25,6 +25,7 @@ StorageReal::StorageReal(CACHE_STORAGE_API* pApi, CACHE_STORAGE* pStorage)
StorageReal::~StorageReal()
{
m_pApi->freeInstance(m_pStorage);
}
cache_result_t StorageReal::get_info(uint32_t flags, json_t** ppInfo) const