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 <set>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
class RclConfig;
|
||||||
|
|
||||||
namespace Dijon
|
namespace Dijon
|
||||||
{
|
{
|
||||||
class Filter;
|
class Filter;
|
||||||
@ -54,7 +56,7 @@ namespace Dijon
|
|||||||
Filter(const std::string &mime_type) : m_mimeType(mime_type) {}
|
Filter(const std::string &mime_type) : m_mimeType(mime_type) {}
|
||||||
/// Destroys the filter.
|
/// Destroys the filter.
|
||||||
virtual ~Filter() {}
|
virtual ~Filter() {}
|
||||||
|
virtual void setConfig(RclConfig *) = 0;
|
||||||
|
|
||||||
// Enumerations.
|
// Enumerations.
|
||||||
|
|
||||||
|
|||||||
@ -315,6 +315,10 @@ Dijon::Filter *getMimeHandler(const string &mtype, RclConfig *cfg,
|
|||||||
out:
|
out:
|
||||||
if (h) {
|
if (h) {
|
||||||
h->set_property(Dijon::Filter::DEFAULT_CHARSET, cfg->getDefCharset());
|
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;
|
return h;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,6 +36,10 @@ public:
|
|||||||
m_forPreview(false), m_havedoc(false)
|
m_forPreview(false), m_havedoc(false)
|
||||||
{}
|
{}
|
||||||
virtual ~RecollFilter() {}
|
virtual ~RecollFilter() {}
|
||||||
|
virtual void setConfig(RclConfig *config)
|
||||||
|
{
|
||||||
|
m_config = config;
|
||||||
|
}
|
||||||
virtual bool set_property(Properties p, const string &v) {
|
virtual bool set_property(Properties p, const string &v) {
|
||||||
switch (p) {
|
switch (p) {
|
||||||
case DJF_UDI:
|
case DJF_UDI:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user