1
0
mirror of synced 2024-11-28 01:20:51 +01:00

fix: GLFW error on exit

This commit is contained in:
WerWolv 2022-08-03 10:45:50 +02:00
parent 0ac8fcd1eb
commit ace25d353b
3 changed files with 10 additions and 3 deletions

View File

@ -95,6 +95,11 @@ namespace hex {
}
}
static void clear() noexcept {
s_events.clear();
s_tokenStore.clear();
}
private:
static std::map<void *, EventList::iterator> s_tokenStore;
static EventList s_events;

View File

@ -163,6 +163,8 @@ namespace hex::init {
}
bool deleteSharedData() {
EventManager::clear();
while (ImHexApi::Provider::isValid())
ImHexApi::Provider::remove(ImHexApi::Provider::get());
ContentRegistry::Provider::getEntries().clear();

View File

@ -160,14 +160,14 @@ namespace hex {
}
Window::~Window() {
this->exitImGui();
this->exitGLFW();
EventManager::unsubscribe<EventProviderDeleted>(this);
EventManager::unsubscribe<RequestCloseImHex>(this);
EventManager::unsubscribe<RequestChangeWindowTitle>(this);
EventManager::unsubscribe<EventAbnormalTermination>(this);
EventManager::unsubscribe<RequestOpenPopup>(this);
this->exitImGui();
this->exitGLFW();
}
void Window::loop() {