diff options
Diffstat (limited to 'plugins/Db3x_mmap')
-rw-r--r-- | plugins/Db3x_mmap/src/dbsettings.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp index 298fd4b2b1..47bfef5e08 100644 --- a/plugins/Db3x_mmap/src/dbsettings.cpp +++ b/plugins/Db3x_mmap/src/dbsettings.cpp @@ -331,20 +331,18 @@ STDMETHODIMP_(BOOL) CDb3Base::FreeVariant(DBVARIANT *dbv) STDMETHODIMP_(BOOL) CDb3Base::SetSettingResident(BOOL bIsResident, const char *pszSettingName)
{
- int cbSettingNameLen = (int)strlen(pszSettingName) + 2;
- if (cbSettingNameLen < 512) {
- char *szSetting = m_cache->InsertCachedSetting(pszSettingName, cbSettingNameLen);
- *szSetting = (char)bIsResident;
-
- mir_cslock lck(m_csDbAccess);
- int idx = m_lResidentSettings.getIndex(szSetting+1);
- if (idx == -1) {
- if (bIsResident)
- m_lResidentSettings.insert(szSetting+1);
- }
- else if (!bIsResident)
- m_lResidentSettings.remove(idx);
+ char *szSetting = m_cache->GetCachedSetting(NULL, pszSettingName, 0, strlen(pszSettingName));
+ szSetting[-1] = (char)bIsResident;
+
+ mir_cslock lck(m_csDbAccess);
+ int idx = m_lResidentSettings.getIndex(szSetting);
+ if (idx == -1) {
+ if (bIsResident)
+ m_lResidentSettings.insert(szSetting);
}
+ else if (!bIsResident)
+ m_lResidentSettings.remove(idx);
+
return 0;
}
|