From 83bbde8d299961a134b088ca69e60e50e4610530 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 1 Feb 2021 20:07:57 +0100 Subject: [PATCH] Fixed multiple memory leaks --- external/ImGui/include/imgui_memory_editor.h | 1 + source/helpers/plugin_handler.cpp | 2 +- source/views/view_pattern.cpp | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/external/ImGui/include/imgui_memory_editor.h b/external/ImGui/include/imgui_memory_editor.h index 94d1d2857..01ce20c73 100644 --- a/external/ImGui/include/imgui_memory_editor.h +++ b/external/ImGui/include/imgui_memory_editor.h @@ -127,6 +127,7 @@ struct MemoryEditor // State/Internals ContentsWidthChanged = false; DataPreviewAddr = DataEditingAddr = DataPreviewAddrEnd = (size_t)-1; + DataPreviewAddrOld = DataPreviewAddrEndOld = (size_t)-1; DataEditingTakeFocus = false; memset(DataInputBuf, 0, sizeof(DataInputBuf)); memset(AddrInputBuf, 0, sizeof(AddrInputBuf)); diff --git a/source/helpers/plugin_handler.cpp b/source/helpers/plugin_handler.cpp index ffcb74d96..0fee48a9a 100644 --- a/source/helpers/plugin_handler.cpp +++ b/source/helpers/plugin_handler.cpp @@ -18,7 +18,7 @@ namespace hex { } Plugin::~Plugin() { - + dlclose(this->m_handle); } void Plugin::initializePlugin() const { diff --git a/source/views/view_pattern.cpp b/source/views/view_pattern.cpp index 8ce13cf1e..f5e11ad56 100644 --- a/source/views/view_pattern.cpp +++ b/source/views/view_pattern.cpp @@ -193,6 +193,8 @@ namespace hex { } ViewPattern::~ViewPattern() { + delete this->m_patternLanguageRuntime; + View::unsubscribeEvent(Events::ProjectFileStore); View::unsubscribeEvent(Events::ProjectFileLoad); }