| 08-26-2006, 10:50 PM | #1 |
can someone please explain these "LEAKS" to me? picking units and things like that thatll leak the groups how can i destroy them, and where do they come in replies are greatly appreciated. |
| 08-26-2006, 10:55 PM | #2 |
How about looking in a Tut? Click here |
| 08-27-2006, 07:59 AM | #3 |
Basically, when you create a handle (a handle is anything but a integer, real, string, code, boolean, such as a unit, or a destructable, or a multiboard) it stores the handle is memory. If you dont set that handle to something (a local or global) then destroy it later, that handle will be undestroyable, so your game is always going to be processing that handle, thats more delay/lag to think about. Example of a leak: JASS:function ThisLeaks takes nothing returns nothing local unit u = CreateUnit(...) call DoStuffWithUnit(...) endfunction JASS:function ThisDosentLeak takes nothing returns nothing local unit u = CreateUnit(...) call DoStuffWithUnit(...) call RemoveUnit(u) set u = null endfunction You must destroy the handle when you'v finished using it! Thats what a leak is, when you have lost the reference to a handle, so its undestroyable. |
| 08-27-2006, 09:31 AM | #4 | |
Quote:
Your example is very bad, as what you are talking about generally doesn't apply to units. The handle hostage leak, yes, but destroying handles no. |
| 08-27-2006, 11:08 AM | #5 |
I just wanted to give a clear idea on what its about. |
| 08-27-2006, 01:10 PM | #6 | |
Quote:
|
| 08-27-2006, 02:53 PM | #7 |
It depends on what he was meaning by 'finished using it'. Ofcourse units should be removed should be removed when they no longer need to be in the game (dummies), but the examples he posted could be misleading. It makes it appear as if the creating a unit and not immediately removing and nullifying makes it leak. |
| 08-27-2006, 02:59 PM | #8 | |
Yeah... in fact you could use anything else, TH. Quote:
^^ |
| 08-27-2006, 08:09 PM | #9 |
well, besides that, i really dont know JASS. can that be explained in WE? |
| 08-27-2006, 10:49 PM | #10 |
Sorry if it seemed misleading. I used a unit because its the first handle that came to mind. |
