| 08-19-2006, 01:58 PM | #2 | |
Quote:
Not at all. That's the point of it: The point that is about to be generated by the next function (that Point(blablah) thing) will be stored within temp-point, and not just float in the air taking valuable space. I think many people don't really understand where do leaks come from. Someone should really write a much newbie friendly explanation of it. Your second trigger doesn't seem to leak either. How often would that run though? Is there any chance it can run more than once at the same time? I say this because of your loop using Integer A, which is a global, and if the same trigger runs more than once in parallel, your loop will conflict a lot. It will also conflict with any other trigger running in parallel and using Integer A |
| 08-19-2006, 02:16 PM | #3 | |
Quote:
That only applies if he uses integer A loops with waits in them. |
| 08-19-2006, 02:20 PM | #4 | |
Quote:
The "Integer A" mentioned here is not a global integer called "A", but rather a device (Index) created by GUI to loop with. At least that's what I think, because you don't even need a global integer if you want to loop in GUI. JASS:
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call DoSomethingWith(bj_forLoopAIndex)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop |
| 08-19-2006, 02:24 PM | #5 |
bj_forLoopAIndex and bj_forLoopAIndexEnd are simply globals which are defined in blizzard.j. |
| 08-19-2006, 03:55 PM | #6 |
blu_da_noob is correct in both instances. I forgot about that it will truly run parallel only with waits. Still, *I* consider it a bad practice, and would suggest using a local instead. |
| 08-19-2006, 10:53 PM | #7 |
Thank you all! Yes, I know that the "Integer A" is global variable so all my loops with waits use my own defined globals. About the set thingy.. I wasn't sure whether it caused a leak when you use "X of point", but thanks for the explaination. I've a lot of other triggers that needs to be checked, but they should be fine. Even if they do got a leak they will only fire about 20 times in a game anyhow.. (I repped ya Alevice) - Soultaker |
