recollindex threads: reset the config pointer when retrieving handler from cache. Seems to have been the cause of the crashes
This commit is contained in:
parent
4afde68f9e
commit
a8f410606d
@ -21,6 +21,8 @@
|
||||
#include <set>
|
||||
#include <map>
|
||||
|
||||
class RclConfig;
|
||||
|
||||
namespace Dijon
|
||||
{
|
||||
class Filter;
|
||||
@ -54,7 +56,7 @@ namespace Dijon
|
||||
Filter(const std::string &mime_type) : m_mimeType(mime_type) {}
|
||||
/// Destroys the filter.
|
||||
virtual ~Filter() {}
|
||||
|
||||
virtual void setConfig(RclConfig *) = 0;
|
||||
|
||||
// Enumerations.
|
||||
|
||||
|
||||
@ -315,6 +315,10 @@ Dijon::Filter *getMimeHandler(const string &mtype, RclConfig *cfg,
|
||||
out:
|
||||
if (h) {
|
||||
h->set_property(Dijon::Filter::DEFAULT_CHARSET, cfg->getDefCharset());
|
||||
// In multithread context, and in case this handler is out
|
||||
// from the cache, it may have a config pointer belonging to
|
||||
// another thread. Fix it.
|
||||
h->setConfig(cfg);
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
@ -36,6 +36,10 @@ public:
|
||||
m_forPreview(false), m_havedoc(false)
|
||||
{}
|
||||
virtual ~RecollFilter() {}
|
||||
virtual void setConfig(RclConfig *config)
|
||||
{
|
||||
m_config = config;
|
||||
}
|
||||
virtual bool set_property(Properties p, const string &v) {
|
||||
switch (p) {
|
||||
case DJF_UDI:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user