fixed misusage, freeing convar info while it can still be read

fixed a minor memory leak

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401584
This commit is contained in:
David Anderson 2007-10-15 19:37:14 +00:00
parent 9396a88fdc
commit 3c0aba7035

View File

@ -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;
}
}