DNESS / cocos2d-iphone

Automatically exported from code.google.com/p/cocos2d-iphone
1 stars 0 forks source link

Dismissing a CCLayer after CCMenuItem press crashes on OSX #1282

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create a CCLayerColor on top of your current layer as a Popup.
2. Create a CCMenu containing a button "Dismiss", with selector "DismissPopup" 
and add it to the layer just created.
3. When "Dismiss" button is pressed call [self removeFromParentAndCleanup:YES] 
inside DismissPopup function to remove the Popup layer.

What is the expected output? What do you see instead?

Popup layer should disappear as it does on iOS devices. On OSX there is a 
random but frequent crash.

What cocos2d version are you using ?

I'm using 1.1, but it's reproducible on gles20 branch as of today.

What iOS / Mac SDK are you using ?

Mac SDK 10.7.

Debug or Release ?

Debug

Which target device / target OS are you using ?

OSX 10.7.

Mac only: x86 or i386 ?

x86 and i386.

Please provide any additional information below.

Original issue reported on code.google.com by att...@gmail.com on 29 Nov 2011 at 7:46

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by ricardoq...@gmail.com on 29 Nov 2011 at 3:13

GoogleCodeExporter commented 9 years ago
Workaround for this is to not use autorelease and deallocate the created popup 
layer on dealloc of the parent layer or if new popup is needed then deallocate 
the old layer before creating a new one.

Original comment by att...@gmail.com on 30 Nov 2011 at 2:37

GoogleCodeExporter commented 9 years ago
thanks. 
fixed in cocos2d v2.0-beta2.

Original comment by ricardoq...@gmail.com on 21 Feb 2012 at 5:24