From 5bfa34d016e11b7e3a293edea62cefe9e0de26e8 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Mon, 16 Sep 2024 12:14:14 +0200 Subject: [PATCH] ModSystem: properly purge and delete all mods on destruction --- src/pluginsystem/modsystem.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/pluginsystem/modsystem.cpp b/src/pluginsystem/modsystem.cpp index 5ccc06bb..e9c0127c 100644 --- a/src/pluginsystem/modsystem.cpp +++ b/src/pluginsystem/modsystem.cpp @@ -26,10 +26,7 @@ static ConVar modsystem_debug("modsystem_debug", "0", FCVAR_RELEASE, "Debug the CModSystem::~CModSystem() { // clear all allocated mod instances. - FOR_EACH_VEC(m_ModList, i) - { - delete m_ModList.Element(i); - } + m_ModList.PurgeAndDeleteElements(); } //-----------------------------------------------------------------------------