Group erase vs delete

g=display.newGroup()

–add objects

display.remove(g)

–try to add objects succeeds but they do not display

is there a way to erase a group?

I have added many properties to g and do not want to delete it and reallocate just to erase the graphic part

i could nest a group

g.group=display.newGroup()  then delete the subgroup and reallocate it but that seems kludgy

local group = display.newGroup() group.purge = function( self ) while self.numChildren \> 0 do display.remove(self[1]) self[1] = nil end end display.newCircle( group, 10, 10, 10 ) display.newCircle( group, 10, 10, 10 ) display.newCircle( group, 10, 10, 10 ) group:purge()

thanks for taking the time to reply

i should have guessed

local group = display.newGroup() group.purge = function( self ) while self.numChildren \> 0 do display.remove(self[1]) self[1] = nil end end display.newCircle( group, 10, 10, 10 ) display.newCircle( group, 10, 10, 10 ) display.newCircle( group, 10, 10, 10 ) group:purge()

thanks for taking the time to reply

i should have guessed