| 08-07-2008, 10:21 AM | #1 |
I just want clarifications on this subject so i can decide whether to use local variables or just use GetSpellTargetUnit() etc. directly in the function parameters. As of right now i directly input the returners in the parameters unless I have to reference to it or its a location, group etc. So will it leak if I do it that way? -Av3n |
| 08-07-2008, 10:24 AM | #2 |
function parameters don't leak handles, but they still can leak objects(locations, timers..) if you don't destroy them. |
| 08-07-2008, 11:11 AM | #3 |
You don't destroy a timer if you didn't create it (because theres no other way to get a timer than using CreateTimer) So the only things you have to destroy which you didn't create are locations obtained from any native (the only natives which return location and don't have xy versions are GetSpellTargetLoc and GetUnitRallyPoint). About handles, GetTrigger* dont increase the reference count on a handle so it wouldnt leak this way either. |
