From 7faed61def32acdff134f0820e02c48bdd406283 Mon Sep 17 00:00:00 2001 From: Richard Helgeby Date: Tue, 29 May 2012 23:29:13 +0200 Subject: [PATCH] Fixed infect timers not completely destroyed on map change. This will possibly fix the memory leak. --- src/zombiereloaded.sp | 1 + src/zr/infect.inc | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/zombiereloaded.sp b/src/zombiereloaded.sp index 0c46161..f7a4545 100644 --- a/src/zombiereloaded.sp +++ b/src/zombiereloaded.sp @@ -191,6 +191,7 @@ public OnMapStart() public OnMapEnd() { // Forward event to modules. + InfectOnMapEnd(); VolOnMapEnd(); VEffectsOnMapEnd(); } diff --git a/src/zr/infect.inc b/src/zr/infect.inc index 80edaf6..91b139f 100644 --- a/src/zr/infect.inc +++ b/src/zr/infect.inc @@ -76,12 +76,12 @@ new bool:bInfectImmune[MAXPLAYERS + 1][2]; /** * Map is starting. */ -InfectOnMapStart() +InfectOnMapEnd() { - // Reset timer handles. Infect timers are invalidated on a map change if - // they are still running, so these handles no longer point to valid timers. - tInfect = INVALID_HANDLE; - tInfectCountdown = INVALID_HANDLE; + // Reset timers. Infect timers are invalidated on a map change if they are + // still running. + ZREndTimer(tInfect); + ZREndTimer(tInfectCountdown); } /**