summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-10-28 17:34:49 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-10-28 17:34:49 +0000
commit162c8ddd463f17d84b7224219119f8acef6ce23d (patch)
tree0cbb4b0396b5fb92ad8e627069aa2c54161844fa /plugins/Db3x_mmap/src
parent5f5b12be632bffdd96181c0b3280b79227ed04f0 (diff)
fix for db_unset() calls over resident variables
git-svn-id: http://svn.miranda-ng.org/main/trunk@15637 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src')
-rw-r--r--plugins/Db3x_mmap/src/dbsettings.cpp10
1 files changed, 8 insertions, 2 deletions
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