View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-09-2018 , 20:08   Re: CreateConVar exits, what about DeleteConVar ?
Reply With Quote #9

Quote:
Originally Posted by Visual77 View Post
Like the topic says. When I unload a certain plugin, I would like all of its created convars to be removed from the server memory. Is that possible, without restarting the server?
CreateConVar tells SourceMod to create a convar or if that convar already exists, return the handle for it.

The second half of the above sentence should tell you why DeleteConVar doesn't exist.

Quote:
Originally Posted by ThatKidWhoGames View Post
This is actually a great question. I imagined closing the ConVar handles would automatically delete the ConVars themselves, however, it doesn't.
When SourceMod creates a convar, SourceMod's core owns said convar (not the plugin) and it sets up the handle security so that plugins/extensions can't close the handle for said convar.

Edit 2 (Edit 1 got baleeted): In the Source 2013 source code, the only command I see for unregistering a ConVar will unregister every convar that a DLL owns. As I mentioned above, SourceMod owns all convars it creates on behalf of a plugin.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-09-2018 at 20:23.
Powerlord is offline