[sword-svn] r3804 - trunk/src/mgr
scribe at crosswire.org
scribe at crosswire.org
Fri Sep 18 16:39:01 EDT 2020
Author: scribe
Date: 2020-09-18 16:39:01 -0400 (Fri, 18 Sep 2020)
New Revision: 3804
Modified:
trunk/src/mgr/swmgr.cpp
Log:
Fixed error in new code dealing with utilModules
Modified: trunk/src/mgr/swmgr.cpp
===================================================================
--- trunk/src/mgr/swmgr.cpp 2020-09-18 20:37:50 UTC (rev 3803)
+++ trunk/src/mgr/swmgr.cpp 2020-09-18 20:39:01 UTC (rev 3804)
@@ -1526,16 +1526,21 @@
void SWMgr::deleteModule(const char *modName) {
ModMap::iterator it = Modules.find(modName);
- if (it == Modules.end()) it = utilModules.find(modName);
if (it != Modules.end()) {
delete (*it).second;
Modules.erase(it);
}
+ else {
+ it = utilModules.find(modName);
+ if (it != utilModules.end()) {
+ delete (*it).second;
+ utilModules.erase(it);
+ }
+ }
}
signed char SWMgr::setCipherKey(const char *modName, const char *key) {
FilterMap::iterator it;
- ModMap::iterator it2;
// check for filter that already exists
it = cipherFilters.find(modName);
@@ -1545,13 +1550,12 @@
}
// check if module exists
else {
- it2 = Modules.find(modName);
- if (it2 == Modules.end()) it2 = utilModules.find(modName);
- if (it2 != Modules.end()) {
+ SWModule *mod = getModule(modName);
+ if (mod) {
SWFilter *cipherFilter = new CipherFilter(key);
cipherFilters.insert(FilterMap::value_type(modName, cipherFilter));
cleanupFilters.push_back(cipherFilter);
- (*it2).second->addRawFilter(cipherFilter);
+ mod->addRawFilter(cipherFilter);
return 0;
}
}
More information about the sword-cvs
mailing list