Index: add call to get rid of filter subprocesses at end of indexing (for the GUI thread)

This commit is contained in:
Jean-Francois Dockes
2010-11-23 19:35:44 +01:00
parent 0accf76b5c
commit 34151006fe
4 changed files with 60 additions and 24 deletions
+11
View File
@@ -141,6 +141,17 @@ void returnMimeHandler(Dijon::Filter *handler)
}
}
void clearMimeHandlerCache()
{
typedef multimap<string, Dijon::Filter*>::value_type value_type;
map<string, Dijon::Filter *>::iterator it;
for (it = o_handlers.begin(); it != o_handlers.end(); it++) {
delete it->second;
}
o_handlers.clear();
}
/* Get handler/filter object for given mime type: */
Dijon::Filter *getMimeHandler(const string &mtype, RclConfig *cfg,
bool filtertypes)
+5
View File
@@ -114,6 +114,11 @@ extern Dijon::Filter *getMimeHandler(const std::string &mtyp, RclConfig *cfg,
/// Free up filter for reuse (you can also delete it)
extern void returnMimeHandler(Dijon::Filter *);
/// Clean up cache at the end of an indexing pass. For people who use
/// the GUI to index: avoid all those filter processes forever hanging
/// off recoll.
extern void clearMimeHandlerCache();
/// Can this mime type be interned ?
extern bool canIntern(const std::string mimetype, RclConfig *cfg);