Hi guys! I've encountered a strange problem a few days ago in my program, and it's driving me crazy.
In my game I use the Game class from the Scaffold project, as the main stage of the game, and an overlay UIView with a second SPView containing a second stage, to show overlaying content. When I'm dismissing the overlay view and clearing it from memory, I call my own loadScene function in the Game class, which purges everything from the stage, and releases the SPTextures, and loads new, and large SPTextures from files.
If the loadScene is called in any other context, it works good, frees memory, loads the new images.
But when I call it while clearing up the other Sparrow stage, the newly loaded SPTextures behave strange: sometimes they don't contain images, only white color, sometimes they show distorted versions of old textures that should have been deleted from memory. If i delay the loadScene call with 0.1 - 0.2 seconds using a juggler, the problem goes away, so I believe it is some kind of concurrence. (the images I'm loading are very big: 2000x640 textures with ~100MB memory usage)
I'm 100% it's my fault, and I'm overlooking something, but maybe someone have already solved a problem like this.
Thanks for your help.