-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Keyvalues/DataPacks memory leaks #212
Labels
bug
Something isn't working
Comments
Well, it turns out FF2R is also leaking DataPack handles. 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);
|
naydef
changed the title
[Bug] Keyvalues memory leak when using weapons with custom attributes
[Bug] Keyvalues/DataPack memory leaks
Jul 2, 2024
naydef
changed the title
[Bug] Keyvalues/DataPack memory leaks
[Bug] Keyvalues/DataPacks memory leaks
Jul 2, 2024
The second type of memory leaks (DataPack one) hasn't been taken care of. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fix diff:
The text was updated successfully, but these errors were encountered: