mirror of
https://github.com/odrling/Aegisub
synced 2025-04-11 22:56:02 +02:00
Initialize the charset converter for the thesaurus sooner
Narrows the window of time for a crash-on-exit when the user exits while a thesaurus is being loaded.
This commit is contained in:
parent
00a3547453
commit
c8033c2ef7
@ -43,6 +43,8 @@ Thesaurus::Thesaurus(agi::fs::path const& dat_path, agi::fs::path const& idx_pat
|
||||
std::string unused_entry_count;
|
||||
getline(idx, unused_entry_count);
|
||||
|
||||
conv.reset(new charset::IconvWrapper(encoding_name.c_str(), "utf-8"));
|
||||
|
||||
// Read the list of words and file offsets for those words
|
||||
for (auto const& line : line_iterator<std::string>(idx, encoding_name)) {
|
||||
std::vector<std::string> chunks;
|
||||
@ -50,8 +52,6 @@ Thesaurus::Thesaurus(agi::fs::path const& dat_path, agi::fs::path const& idx_pat
|
||||
if (chunks.size() == 2)
|
||||
offsets[chunks[0]] = atoi(chunks[1].c_str());
|
||||
}
|
||||
|
||||
conv.reset(new charset::IconvWrapper(encoding_name.c_str(), "utf-8"));
|
||||
}
|
||||
|
||||
Thesaurus::~Thesaurus() { }
|
||||
|
Loading…
x
Reference in New Issue
Block a user