0

I have a cocos2d Mac application. I get random crashes when creating and adding Sprites.

Bascially i get SIGABRT on

// flush buffer
[self.view.openGLContext flushBuffer];

in CCDirectorMac.

Screenshot here: http://www.zentralnorden.com/temp/crash0220.png

Any advice on how to approach this is helpfull.

Alex
  • 541
  • 5
  • 19
  • 1
    Could be any number of things. I suggest to start with an empty mac project template to see if you can verify this as a general (ie on your machine in general) vs a project-specific issue. Also make sure cocos2d autoscaling is disabled, it's experimental. – CodeSmile Feb 20 '13 at 13:00
  • Autoscaling was indeed active. I will observe if the bug could be related to this. Could it also be possible that the problem is caused because i create the Sprites from a different Thread then CCDirector? (It is a level editor and the sprites are generated after a drop from a tableview to a view under the openglview..). I am really stuck in how to approach debugging here. The project is quiet big.. – Alex Feb 20 '13 at 13:55

1 Answers1

1

The reason was..

I am building a Level-Editor and the Sprites were created in a different Thread as the CCDirectorMac runs on. I now add notifications into a queue and then on the CCLayer i check if somethings is in this queue and if yes, create the needed Sprites from there. Since i do this i have no more problems.

Alex
  • 541
  • 5
  • 19