1
0
mirror of synced 2024-11-24 15:50:16 +01:00

fix: Pattern source code being deleted when closing a provider

This commit is contained in:
WerWolv 2022-02-05 22:26:00 +01:00
parent ca57f91bfa
commit eade95dff7
3 changed files with 2 additions and 4 deletions

View File

@ -111,7 +111,7 @@ namespace hex {
s_providers.erase(it);
if (it - s_providers.begin() == s_currentProvider)
s_currentProvider = 0;
setCurrentProvider(0);
delete provider;
}

View File

@ -14,7 +14,6 @@
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
#include <hex/ui/imgui_data_visualizers.hpp>
namespace hex::plugin::builtin {

View File

@ -145,8 +145,7 @@ namespace hex::plugin::builtin {
}
});
EventManager::subscribe<EventFileUnloaded>(this, [this] {
this->m_textEditor.SetText("");
EventManager::subscribe<EventFileUnloaded>(this, [] {
ImHexApi::Provider::get()->getPatternLanguageRuntime().abort();
});