StorageCache dtor leaks

Former-commit-id: 0262c4dc76a320141b8a4454df2f6baab4f74ab3
This commit is contained in:
John Sully 2021-07-19 15:10:48 +00:00
parent 4000334b1f
commit 614860ce3c
2 changed files with 8 additions and 0 deletions

View File

@ -25,6 +25,12 @@ StorageCache::StorageCache(IStorage *storage, bool fCache)
m_pdict = dictCreate(&dbStorageCacheType, nullptr);
}
StorageCache::~StorageCache()
{
if (m_pdict != nullptr)
dictRelease(m_pdict);
}
void StorageCache::clear()
{
std::unique_lock<fastlock> ul(m_lock);

View File

@ -29,6 +29,8 @@ class StorageCache
}
public:
~StorageCache();
static StorageCache *create(IStorageFactory *pfactory, int db, IStorageFactory::key_load_iterator fn, void *privdata) {
StorageCache *cache = new StorageCache(nullptr, pfactory->FSlow() /*fCache*/);
load_iter_data data = {cache, fn, privdata};