Open naydef opened 1 month ago
Well, it turns out FF2R is also leaking DataPack handles.
It seems it's due to assuming that CreateDataTimer
is not creating the DataPack
itself.
Fix diff (ignore whitespace changes):
---------- addons/sourcemod/scripting/freak_fortress_2/attributes.sp ----------
index edc65800..8fa2cfd2 100755
@@ -88,7 +88,7 @@ bool Attributes_OnBackstabBoss(int attacker, int victim, float &damage, int weap
/*
if(Attributes_FindOnWeapon(attacker, weapon, 217)) // sanguisuge
{
-
+
int maxoverheal = TF2U_GetMaxOverheal(attacker) * 2; // 250% overheal (from 200% overheal)
int health = GetClientHealth(attacker);
if(health < maxoverheal)
@@ -105,7 +105,7 @@ bool Attributes_OnBackstabBoss(int attacker, int victim, float &damage, int weap
if(TF2_IsPlayerInCondition(attacker, TFCond_Plague))
TF2_RemoveCondition(attacker, TFCond_Plague);
}
-
+
}
*/
@@ -311,7 +311,7 @@ void Attributes_OnHitBoss(int attacker, int victim, int inflictor, float fdamage
if(Attributes_FindOnPlayer(attacker, 418) > 0.0) // boost on damage
{
- DataPack pack = new DataPack();
+ DataPack pack;
if(Enabled)
{
CreateDataTimer(0.1, Attributes_BoostDrainStack, pack, TIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT);
----------- addons/sourcemod/scripting/freak_fortress_2/commands.sp -----------
index 614dc0eb..4f7a3df2 100755
@@ -275,7 +275,7 @@ static Action SwapTeam(int client, int wantTeam)
if(Cvar[AggressiveSwap].BoolValue)
{
- DataPack pack = new DataPack();
+ DataPack pack;
CreateDataTimer(0.2, Command_AggressiveSwap, pack, TIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT);
pack.WriteCell(GetClientUserId(client));
pack.WriteCell(newTeam);
The second type of memory leaks (DataPack one) hasn't been taken care of.
Fix diff: