Fixed reentrancy problems with iterators, forwards, and function removals (bug

4059, r=fyren).
This commit is contained in:
David Anderson
2010-01-10 16:58:17 -08:00
parent 306ac5243a
commit 4631282709
4 changed files with 124 additions and 8 deletions
+31
View File
@@ -0,0 +1,31 @@
#include <sourcemod>
public OnPluginStart()
{
new Handle:hostname = FindConVar("hostname")
HookConVarChange(hostname, OnChange)
HookEvent("player_team", cb)
RegServerCmd("test_bug4059", Test_Bug)
}
public Action:cb(Handle:event, const String:name[], bool:dontBroadcast)
{
UnhookEvent(name, cb)
PrintToServer("whee")
HookEvent(name, cb)
return Plugin_Handled
}
public OnChange(Handle:convar, const String:oldValue[], const String:newValue[])
{
PrintToServer("called: %x", convar)
UnhookConVarChange(convar, OnChange)
ResetConVar(convar)
HookConVarChange(convar, OnChange)
}
public Action:Test_Bug(args)
{
ServerCommand("hostname \"bug4059\"")
}