From 8d941dc1009c5ff66ddde65b913772e61f6776de Mon Sep 17 00:00:00 2001 From: steph Date: Wed, 4 Aug 2021 19:19:13 -0400 Subject: [PATCH] get rid of a memleak due to FireToClient not closing handles after it's fired --- addons/sourcemod/scripting/nativevotes/game.sp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/sourcemod/scripting/nativevotes/game.sp b/addons/sourcemod/scripting/nativevotes/game.sp index 0f63128..e132bbc 100644 --- a/addons/sourcemod/scripting/nativevotes/game.sp +++ b/addons/sourcemod/scripting/nativevotes/game.sp @@ -2368,6 +2368,8 @@ static void TF2CSGO_SendOptionsToClient(NativeVote vote, int client) } optionsEvent.SetInt("count", itemCount); optionsEvent.FireToClient(client); + // FireToClient does not close the handle, so we call Cancel() to do that for us. + optionsEvent.Cancel(); } static void CSGO_VotePass(const char[] translation, const char[] details, int team, int client=0) @@ -3553,4 +3555,4 @@ stock bool Game_IsVoteTypeYesNo(NativeVotesType voteType) } return true; -} \ No newline at end of file +}