gemidyne / microtf2

A custom gamemode for Team Fortress 2 - Players compete against each other to get the most points by playing a series of rapid fire microgames in order to win the round!
https://www.gemidyne.com/projects/microtf2
GNU General Public License v2.0
32 stars 17 forks source link

Fix memory leak from annotations #158

Closed FortyTwoFortyTwo closed 4 years ago

FortyTwoFortyTwo commented 4 years ago

This commit https://github.com/gemidyne/microtf2/commit/e2e6db423b47cd0c1e158623866797ad7cdc37a0 changes the way event is handled. Event.Fire/FireEvent auto deletes handle itself, but Event.FireToClient does NOT auto deletes handle itself, so that has to be deleted manually.

Untested but im 99% sure thats why as i got error log from that, plugin unloads itself

safalin1 commented 4 years ago

Thanks for this! Good catch - apologies we didn't catch this during testing.

safalin1 commented 4 years ago

From what I can see - using the delete keyword is the best way to resolve this. Thanks again for the PR :)