You can make objects, manipulate them, schedule the changes, but you eventually need to do something like: Director::getInstance()->getScheduler()->performFunctionInCocosThread
Can anyone else chime in with feedback about this?
I mainly want to use the collections Map and Array, as it is really convenient to remove something from a Collection and not having to delete the object manually.
When not using autorelease at all, it should be safe to do it on another thread, right?
You could just use the STL containers combined with the C++11 smart pointers.
The containers offer the same functionality and you can easily implement your multi-threading needs.
Well, I’m not really familiar with the STL containers and smart pointers, but it might a good idea to learn them.
I come from Objective-C, so the release() / retain() mechanism makes a lot of sense to me, and the cocos2d-containers are modeled after the containers I know from there.
So which containers would have a similar behaviour?
Hence, when removing an object from them, the object gets deallocated just like with cocos2d::Map and cocos2d::Vector.
If anybody can show me a minimal example of how this works, I’ll be gladly going this way.