Hi,

In a Layer, I draw 9 sprites every second.
Every second, I remove the 9 previous sprites.

############################################
class Test(Layer):

    is_event_handler = True

    def __init__(self):
        super(Test, self ).__init__()
        self.sprites = []

    def on_enter(self):
        super(Test, self).on_enter()
        self.schedule_interval(self.update_map, 1.)

    def update_map(self, dt):
        for s in self.sprites:
            self.remove(s)
            del(s)
        self.sprites = []
        for i in range(9):
            im = 'im_z{0}_x{1}.png'.format(i, randint(0, 1000))
            s = Sprite(im)
            self.sprites.append(s)
            self.add(s)
############################################

every second, I remove the sprites and delete them, with:
            self.remove(s)
            del(s)

however, the memory rises continuously.
If I remove that "self.schedule_interval(self.update_map, 1.)" -> no
leak.

Any idea ?
thanks !

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cocos-discuss?hl=en.

Reply via email to