Hey, the code is too messy and long for me to create a bugcode as I can't 
pinpoint where the issue occurs. anyway, it only happens now when I'm 
dealing with insanely large amount of sprites and pymunk bodies. as long as 
I keep it in reasonable amounts it's a none issue.
thanks anyway for your fast support! sorry if I wasted your time. 

On Thursday, November 5, 2015 at 5:37:39 PM UTC+2, Claudio Canepa wrote:
>
>
> Hi netanel,
>
>
> On Thu, Nov 5, 2015 at 11:26 AM, Netanel M. <[email protected] 
> <javascript:>> wrote:
>
>> I'm getting crashes every few minutes. It happens when I try to remove a 
>> child from a batchnode. I'm getting these errors:
>> Exception: Child not found: <cocos.sprite.Sprite object at 0x0C8E3E90>
>>
>>
>> ...
>  
>
>> I have no idea what's wrong here, my code seems fine. and the issue only 
>> rises sometimes, usually it's okay. so maybe there's a memory leak here, 
>> coming from the batchnode code?
>> Or maybe I'm using batchnodes incorrectly. is it okay to add and remove 
>> objects from different update functions? or are they not thread safe?
>> Has anyone else had this problem?
>>   
>
>
> I think it its safe to call add - remove from different update functions 
> **in the main thread**, the one that runs on_draw.
>
> It is not thread-safe.
>
> If you are using threads, then I cannot suggest anything specific without 
> more details; a working reduced bugdemo would reduce a lot the time to 
> communicate what exactly the situation is.
>
> Some discussion about how to use threads had come to the list [0], 
> examples posted that can help to make a bugdemo tailored to your situation.
>
> To answer your question in your follow-up mail, I think you can remove 
> from a batchnode within a CallFunc if the CallFunc runs in the main thread. 
>
> [0] 
> http://search.gmane.org/search.php?group=gmane.comp.python.cocos2d.user&query=thread
>

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to