Warcraft III resources & community, 2003–2006 · archived

Memory leak - Quick Answer Plz

10 posts
#1

Memory leak - Quick Answer Plz

hi

does using the func:
pick every unit in GROUP (its a variable, not a function) and do...
over and over leak?

thank you
#2
This if ForGroupBJ function. I saw the thread where Darky28 itself recommended this construction :

local group g = CreateGroup()
local unit u

...

set u = FirstOfGroup(g)
loop
  exitwhen u = null
  set u = FirstOfGroup(g)
  call RemoveUnit(u)     // for example
endloop

...

call DestroyGroup(g)
set g = null
set u = null
[/jass]
#3
you didnt answer my question :?

and dont give me JASS scripts - i dont know JASS...
#4
As I wrote, I think it leaks. Ask KaTTaNa about it or someone who knows. I posted this in jass because this is jass forum and I thought you know JASS.
#5
u=FirstOfGroup(g) can be inside the loop, before the exitwhen. also this wont leak (for what i know), setting u to null at the end is unneeded (it allready is) and it would make sense to have g as an auxiliar group, not using the main group.
#6
Whats an auxiliar group?
#7
auxiliary (~help), i missed the Y, sorry.
that means when you have a group and use this it will become empty. so add the main group to the new
#8
WTF, people???

just give me a 'yes' or 'no'..... :?
#9
darkys does NOT leak !
and none seems to know about the native.
#10
No,i think they dont,but dont use more than 2 or 3 at a time