From bc799ef31a15887f67820a6c5c5c130c401e1fb5 Mon Sep 17 00:00:00 2001 From: ALittlePatate Date: Thu, 4 Jan 2024 20:05:57 +0100 Subject: [PATCH] fix: memory leak, not unloading the map --- ImGuiExternal/Source.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ImGuiExternal/Source.cpp b/ImGuiExternal/Source.cpp index a49bbb1..762de67 100644 --- a/ImGuiExternal/Source.cpp +++ b/ImGuiExternal/Source.cpp @@ -94,6 +94,8 @@ void Draw() { if (map_name[0] == '\0') return; if (std::string(map_name) != map_name_old || !parsed_map) { + if (parsed_map) + _bsp_parser.unload_map(); parsed_map = _bsp_parser.load_map(std::string(Game::path) + std::string("cstrike\\maps"), map_name); map_name_old = std::string(map_name); }