Crash when using my own C++ objects

Crash when using my own C++ objects
0.0 0


Hi, I created a simple example inline, i.e. created sprites and labels in the init() method of the Layer and manipulate with a schedule method. However, when I moved this logic to a custom class, e.g. Player, I passed in the layer and retained it, created the sprite in the init method, etc. In first view is works fine, however on first update in the schedule (0.2 seconds layer) the class has lost the retained reference to the layer. Is this a known problem?

I tried using the safe macro to retain and my own call to ->retain() on the layer object, it is definitely non-null. However in update method, the layer field, that I retained, it null. Still within the same layer as far as I know.