sourcemod-nativevotes
sourcemod-nativevotes copied to clipboard
Memory Leak
I am getting a memory leak.
L 08/09/2019 - 16:45:46: [SM] MEMORY LEAK DETECTED IN PLUGIN (file "nativevotes.smx")
L 08/09/2019 - 16:45:46: [SM] Unloading plugin to free 9280 handles.
L 08/09/2019 - 16:45:46: [SM] Contact the author(s) of this plugin to correct this error.
L 08/09/2019 - 16:45:46: --------------------------------------------------------------------------
L 08/09/2019 - 16:45:46: Type GameEvent | Count 9258
L 08/09/2019 - 16:45:46: Type GlobalFwd | Count 1
L 08/09/2019 - 16:45:46: Type PrivateFwd | Count 20
L 08/09/2019 - 16:45:46: Type CellArray | Count 1
L 08/09/2019 - 16:45:46: -- Approximately 136 bytes of memory are in use by (9280) Handles.
I think maybe it is because this event isn't being closed. I am not sure.
https://github.com/powerlord/sourcemod-nativevotes/blob/9793001c309c1b6d419ae288bf9f350829bfa8d7/addons/sourcemod/scripting/nativevotes/game.sp#L2370
https://sm.alliedmods.net/new-api/events/Event/FireToClient
Unlike Fire, this function DOES NOT close the event Handle.
https://github.com/powerlord/sourcemod-nativevotes/pull/9 fixes this