From 162c8ddd463f17d84b7224219119f8acef6ce23d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 28 Oct 2015 17:34:49 +0000 Subject: fix for db_unset() calls over resident variables git-svn-id: http://svn.miranda-ng.org/main/trunk@15637 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbsettings.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp index 4e444eaa67..76122610f9 100644 --- a/plugins/Db3x_mmap/src/dbsettings.cpp +++ b/plugins/Db3x_mmap/src/dbsettings.cpp @@ -770,9 +770,15 @@ STDMETHODIMP_(BOOL) CDb3Mmap::DeleteContactSetting(MCONTACT contactID, LPCSTR sz } DBMoveChunk(ofsSettingToCut, ofsSettingToCut + nameLen + valLen, ofsBlobPtr + 1 - ofsSettingToCut); DBFlush(1); - } - m_cache->GetCachedValuePtr(saveContact, szCachedSettingName, -1); + // remove a value from cache anyway + m_cache->GetCachedValuePtr(saveContact, szCachedSettingName, -1); + } + else { // resident variable + // if a value doesn't exist, simply return error + if (m_cache->GetCachedValuePtr(saveContact, szCachedSettingName, -1) == NULL) + return 1; + } } // notify -- cgit v1.2.3