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:
		
							parent
							
								
									9396a88fdc
								
							
						
					
					
						commit
						3c0aba7035
					
				| @ -228,13 +228,14 @@ void ConVarManager::OnHandleDestroy(HandleType_t type, void *object) | |||||||
| 	/* If convar was created by SourceMod plugin... */ | 	/* If convar was created by SourceMod plugin... */ | ||||||
| 	if (info->sourceMod) | 	if (info->sourceMod) | ||||||
| 	{ | 	{ | ||||||
|  | 		/* Then unlink it from SourceMM */ | ||||||
|  | 		g_SMAPI->UnregisterConCommandBase(g_PLAPI, pConVar); | ||||||
|  | 
 | ||||||
| 		/* Delete string allocations */ | 		/* Delete string allocations */ | ||||||
| 		delete [] pConVar->GetName();  | 		delete [] pConVar->GetName();  | ||||||
| 		delete [] pConVar->GetDefault(); | 		delete [] pConVar->GetDefault(); | ||||||
| 		delete [] pConVar->GetHelpText(); | 		delete [] pConVar->GetHelpText(); | ||||||
| 
 | 		delete pConVar; | ||||||
| 		/* Then unlink it from SourceMM */ |  | ||||||
| 		g_SMAPI->UnregisterConCommandBase(g_PLAPI, pConVar); |  | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user