1
0
mirror of synced 2024-11-12 02:00:52 +01:00

fix: More invalid iterator accesses

This commit is contained in:
WerWolv 2023-01-03 13:04:36 +01:00
parent f21c80c48a
commit 01917439dd
2 changed files with 4 additions and 2 deletions

View File

@ -2041,7 +2041,9 @@ void TextEditor::ColorizeInternal() {
}
}
}
line[currentIndex].mPreprocessor = withinPreproc;
if (currentIndex < line.size())
line[currentIndex].mPreprocessor = withinPreproc;
currentIndex += UTF8CharLength(c);
if (currentIndex >= (int)line.size()) {
currentIndex = 0;

View File

@ -312,13 +312,13 @@ namespace hex {
EventManager::post<EventProviderDeleted>(provider);
s_providers.erase(it);
if (s_providers.empty())
EventManager::post<EventProviderChanged>(provider, nullptr);
else if (it - s_providers.begin() == s_currentProvider)
setCurrentProvider(0);
s_providers.erase(it);
provider->close();
EventManager::post<EventProviderClosed>(provider);