Missing ParamStale initialization would crash GUI when clicking Open after indexing config update. Fixes issue #284
This commit is contained in:
parent
b56778875e
commit
b15fd92697
2 changed files with 17 additions and 27 deletions
|
@ -112,13 +112,7 @@ void RclConfig::zeroMe() {
|
||||||
m_ptrans = 0;
|
m_ptrans = 0;
|
||||||
m_stopsuffixes = 0;
|
m_stopsuffixes = 0;
|
||||||
m_maxsufflen = 0;
|
m_maxsufflen = 0;
|
||||||
|
initParamStale(0, 0);
|
||||||
m_oldstpsuffstate.init(0);
|
|
||||||
m_stpsuffstate.init(0);
|
|
||||||
m_skpnstate.init(0);
|
|
||||||
m_rmtstate.init(0);
|
|
||||||
m_xmtstate.init(0);
|
|
||||||
m_mdrstate.init(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RclConfig::isDefaultConfig() const
|
bool RclConfig::isDefaultConfig() const
|
||||||
|
@ -281,12 +275,7 @@ RclConfig::RclConfig(const string *argcnf)
|
||||||
m_ok = true;
|
m_ok = true;
|
||||||
setKeyDir(cstr_null);
|
setKeyDir(cstr_null);
|
||||||
|
|
||||||
m_oldstpsuffstate.init(mimemap);
|
initParamStale(m_conf, mimemap);
|
||||||
m_stpsuffstate.init(m_conf);
|
|
||||||
m_skpnstate.init(m_conf);
|
|
||||||
m_rmtstate.init(m_conf);
|
|
||||||
m_xmtstate.init(m_conf);
|
|
||||||
m_mdrstate.init(m_conf);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -302,20 +291,14 @@ bool RclConfig::updateMainConfig()
|
||||||
stringsToString(m_cdirs, where);
|
stringsToString(m_cdirs, where);
|
||||||
m_reason = string("No/bad main configuration file in: ") + where;
|
m_reason = string("No/bad main configuration file in: ") + where;
|
||||||
m_ok = false;
|
m_ok = false;
|
||||||
m_skpnstate.init(0);
|
initParamStale(0, 0);
|
||||||
m_rmtstate.init(0);
|
|
||||||
m_xmtstate.init(0);
|
|
||||||
m_mdrstate.init(0);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete m_conf;
|
delete m_conf;
|
||||||
m_conf = newconf;
|
m_conf = newconf;
|
||||||
|
|
||||||
m_skpnstate.init(m_conf);
|
initParamStale(m_conf, mimemap);
|
||||||
m_rmtstate.init(m_conf);
|
|
||||||
m_xmtstate.init(m_conf);
|
|
||||||
m_mdrstate.init(m_conf);
|
|
||||||
|
|
||||||
setKeyDir(cstr_null);
|
setKeyDir(cstr_null);
|
||||||
|
|
||||||
|
@ -1498,16 +1481,21 @@ void RclConfig::initFrom(const RclConfig& r)
|
||||||
m_maxsufflen = r.m_maxsufflen;
|
m_maxsufflen = r.m_maxsufflen;
|
||||||
m_defcharset = r.m_defcharset;
|
m_defcharset = r.m_defcharset;
|
||||||
|
|
||||||
m_oldstpsuffstate.init(mimemap);
|
initParamStale(m_conf, mimemap);
|
||||||
m_stpsuffstate.init(m_conf);
|
|
||||||
m_skpnstate.init(m_conf);
|
|
||||||
m_rmtstate.init(m_conf);
|
|
||||||
m_xmtstate.init(m_conf);
|
|
||||||
m_mdrstate.init(m_conf);
|
|
||||||
|
|
||||||
m_thrConf = r.m_thrConf;
|
m_thrConf = r.m_thrConf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RclConfig::initParamStale(ConfNull *cnf, ConfNull *mimemap)
|
||||||
|
{
|
||||||
|
m_oldstpsuffstate.init(mimemap);
|
||||||
|
m_stpsuffstate.init(cnf);
|
||||||
|
m_skpnstate.init(cnf);
|
||||||
|
m_rmtstate.init(cnf);
|
||||||
|
m_xmtstate.init(cnf);
|
||||||
|
m_mdrstate.init(cnf);
|
||||||
|
}
|
||||||
|
|
||||||
#else // -> Test
|
#else // -> Test
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
@ -382,6 +382,8 @@ class RclConfig {
|
||||||
|
|
||||||
/** Create initial user configuration */
|
/** Create initial user configuration */
|
||||||
bool initUserConfig();
|
bool initUserConfig();
|
||||||
|
/** Init all ParamStale members */
|
||||||
|
void initParamStale(ConfNull *cnf, ConfNull *mimemap);
|
||||||
/** Copy from other */
|
/** Copy from other */
|
||||||
void initFrom(const RclConfig& r);
|
void initFrom(const RclConfig& r);
|
||||||
/** Init pointers to 0 */
|
/** Init pointers to 0 */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue