Agreed, stickies could be nice to help people not familiar..
You should store the location in a locl and when you don't need the location longer remove it and nullify the variable.. Like this:
function Jass takes nothing returns nothing
local location l = GetSpellTargetLoc()
//actions using the loc
call RemoveLocation(l)
set l = null
endfunction
As far as I know GetTriggerUnit doesn't leak, but if you're using it a lot of times within a function, store it in a variable anyway, thats easier..
GetLastCreatedEffect is dumb and should very seldom be used in Jass... Instead of
function Hey takes nothing returns nothing
local location l = GetSpellTargetLoc()
local effect e
call AddSpecialEffectLoc("somePath", l)
set e = GetLastCreatedEffect()
...
You should use:
function Hello takes nothing returns nothing
local location l = GetSpellTargetLoc()
local effect e = AddSpecialEffectLoc("somePath", l)
...
Since all natives that adds special effects returns the effects thats the easiest way..
Because of we haven't got any Jass section nor forum mods I am at The Jass Vault for Jass purposes...
Hopefully that helped you (the scripts not that I'm at The Jass Vault)..