mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Also hold global lock when constructing a tokenizer and setting its current_ui_language
This commit is contained in:
parent
d9b773bd19
commit
ef78b19912
@ -238,7 +238,7 @@ public:
|
|||||||
int constructor_error;
|
int constructor_error;
|
||||||
Tokenizer(const char **args, int nargs) :
|
Tokenizer(const char **args, int nargs) :
|
||||||
remove_diacritics(true), diacritics_remover(),
|
remove_diacritics(true), diacritics_remover(),
|
||||||
byte_offsets(), token_buf(), current_ui_language(ui_language),
|
byte_offsets(), token_buf(), current_ui_language(""),
|
||||||
current_callback(NULL), current_callback_ctx(NULL), iterators(),
|
current_callback(NULL), current_callback_ctx(NULL), iterators(),
|
||||||
|
|
||||||
constructor_error(SQLITE_OK)
|
constructor_error(SQLITE_OK)
|
||||||
@ -259,6 +259,8 @@ public:
|
|||||||
remove_diacritics = false;
|
remove_diacritics = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
std::lock_guard<std::mutex> lock(global_mutex);
|
||||||
|
current_ui_language = ui_language;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tokenize(void *callback_ctx, int flags, const char *text, int text_sz, token_callback_func callback) {
|
int tokenize(void *callback_ctx, int flags, const char *text, int text_sz, token_callback_func callback) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user