From c9b80a70cdc7fcf81f6ce9c65e0f9250279622aa Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 21 Jan 2024 20:24:44 +0100 Subject: [PATCH] Playlists: fix resource/memory leak Remove workaround that was implemented to counter a crash during the beginning of this project, this issue was long solved but the workaround was never removed. Clearing the last precached VPK name prevents the engine from helping other threads to properly unload existing handles, if at all. --- src/networksystem/listmanager.cpp | 2 +- src/rtech/playlists/playlists.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/networksystem/listmanager.cpp b/src/networksystem/listmanager.cpp index 066041fc..951818d8 100644 --- a/src/networksystem/listmanager.cpp +++ b/src/networksystem/listmanager.cpp @@ -70,7 +70,7 @@ void CServerListManager::LaunchServer(const bool bChangeLevel) const m_Server.m_svHostName.c_str(), m_Server.m_svHostMap.c_str(), m_Server.m_svPlaylist.c_str()); /* - * Playlist gets parsed in two instances, first in KeyValues::ParsePlaylists with all the necessary + * Playlist gets parsed in two instances, first in Playlists_Parse() with all the necessary * values. Then when you would normally call launchplaylist which calls StartPlaylist it would cmd * call mp_gamemode which parses the gamemode specific part of the playlist.. */ diff --git a/src/rtech/playlists/playlists.cpp b/src/rtech/playlists/playlists.cpp index 8d285b58..50039276 100644 --- a/src/rtech/playlists/playlists.cpp +++ b/src/rtech/playlists/playlists.cpp @@ -53,8 +53,6 @@ bool Playlists_Load(const char* pszPlaylist) //----------------------------------------------------------------------------- bool Playlists_Parse(const char* pszPlaylist) { - g_szMTVFItemName[0] = '\0'; // Terminate g_szMTVFTaskName to prevent crash while loading playlist. - CHAR sPlaylistPath[] = "\x77\x27\x35\x2b\x2c\x6c\x2b\x2c\x2b"; PCHAR curr = sPlaylistPath; while (*curr)