- Joined
- Sep 25, 2005
- Messages
- 71
Is there some manner of fashion I can check if I'm inadvertently leaking? I mean, I can't tell if this is bad:
compared to this:
Basically, I know you need to remove/destroy/then null anything not integer, real, boolean or string, right? Does .destroy() a struct work correctly for ALL the variables or do say, units need removed from inside an .onDestroy() method? That's what I've been doing just for safe sake.
I'd just like to know if the wc3 memory usage will change or anything that can alert me to whether I did something wrong or right exists. I remove and null all my handles that I'm aware of, but I'm not sure whether I missed something...
JASS:
private static method Check takes nothing returns boolean
return not IsUnitAlly(GetAttacker(), GetOwningPlayer(GetTriggerUnit()))/*
*/and GetUnitAbilityLevel(GetTriggerUnit(), ABIL_ID) >= 1 /*
*/and ValidGroundTarget(GetAttacker(), GetTriggerUnit())
endmethod
compared to this:
JASS:
private static method Check takes nothing returns boolean
local unit attacker = GetAttacker()
local unit attacked = GetTriggerUnit()
if not IsUnitAlly(attacker, GetOwningPlayer(attacked))/*
*/and GetUnitAbilityLevel(attacked, ABIL_ID) >= 1 /*
*/and GetUnitAbilityLevel(attacked, REAL_ID) >= 1/*
*/and ValidGroundTarget(attacker, attacked) /*
*/and IsUnitInRange(attacker, attacked, RANGE) then
call CounternovaData.create()
endif
set attacker = null
set attacked = null
return false
endmethod
Basically, I know you need to remove/destroy/then null anything not integer, real, boolean or string, right? Does .destroy() a struct work correctly for ALL the variables or do say, units need removed from inside an .onDestroy() method? That's what I've been doing just for safe sake.
I'd just like to know if the wc3 memory usage will change or anything that can alert me to whether I did something wrong or right exists. I remove and null all my handles that I'm aware of, but I'm not sure whether I missed something...