about setting variables to nil

I have a local function test as follows :

  
local function test()  
 group = display.newGroup()  
 local backgroundImg = display.newImage ("logo.png")  
 group:insert (backgroundImg, false)  
end  
  

I am calling this function more than once. Do I need to remove objects from the group and set them to nil before calling the function again?
[import]uid: 6661 topic_id: 1950 reply_id: 301950[/import]

If you remove the group, that will remove any objects in the group. If you keep calling this function without removing the group, you will keep creating new groups that you can’t access/access. This would be equivalent to a memory leak, which could crash the app depending on the size and number of images/objects used.

-Tom [import]uid: 7559 topic_id: 1950 reply_id: 6223[/import]