| 172 | } |
| 173 | |
| 174 | void ConVarManager::OnUnlinkConCommandBase(ConCommandBase *pBase, const char *name) |
| 175 | { |
| 176 | /* Only check convars that have not been created by SourceMod's core */ |
| 177 | ConVarInfo *pInfo; |
| 178 | if (!convar_cache_lookup(name, &pInfo)) |
| 179 | { |
| 180 | return; |
| 181 | } |
| 182 | |
| 183 | HandleSecurity sec(NULL, g_pCoreIdent); |
| 184 | |
| 185 | /* Remove it from our cache */ |
| 186 | m_ConVars.remove(pInfo); |
| 187 | convar_cache.remove(name); |
| 188 | |
| 189 | /* Now make sure no plugins are referring to this pointer */ |
| 190 | IPluginIterator *pl_iter = scripts->GetPluginIterator(); |
| 191 | while (pl_iter->MorePlugins()) |
| 192 | { |
| 193 | IPlugin *pl = pl_iter->GetPlugin(); |
| 194 | |
| 195 | ConVarList *pConVarList; |
| 196 | if (pl->GetProperty("ConVarList", (void **)&pConVarList, true) |
| 197 | && pConVarList != NULL) |
| 198 | { |
| 199 | pConVarList->remove(pInfo->pVar); |
| 200 | } |
| 201 | |
| 202 | pl_iter->NextPlugin(); |
| 203 | } |
| 204 | |
| 205 | /* Free resources */ |
| 206 | handlesys->FreeHandle(pInfo->handle, &sec); |
| 207 | delete pInfo; |
| 208 | } |
| 209 | |
| 210 | void ConVarManager::OnPluginUnloaded(IPlugin *plugin) |
| 211 | { |
nothing calls this directly
no test coverage detected