diff --git a/core/ConVarManager.cpp b/core/ConVarManager.cpp index 01e8e178..ae60e192 100644 --- a/core/ConVarManager.cpp +++ b/core/ConVarManager.cpp @@ -228,13 +228,14 @@ void ConVarManager::OnHandleDestroy(HandleType_t type, void *object) /* If convar was created by SourceMod plugin... */ if (info->sourceMod) { + /* Then unlink it from SourceMM */ + g_SMAPI->UnregisterConCommandBase(g_PLAPI, pConVar); + /* Delete string allocations */ delete [] pConVar->GetName(); delete [] pConVar->GetDefault(); delete [] pConVar->GetHelpText(); - - /* Then unlink it from SourceMM */ - g_SMAPI->UnregisterConCommandBase(g_PLAPI, pConVar); + delete pConVar; } }