I'm going to hijack this, since I figure that two threads with the same topic is probably not the best idea.
I got the "[Fault] exception, information=Error: Error #3691: Resource limit for this resource type exceeded." error in my code despite doing everything right (or so I think). My code is based on the Flixel framework which I have hacked so that it uses Starling for the rendering. Upon the creation of my game, I instantiate a whole bunch of sprites, textures, movieclips, etc. This is fine, but when I switch to a new level, I dispose of everything that I previously created and do it all over again. After going to 3 or so levels, I would run into the aforementioned error.
I searched high and low and for the cause of the error and took the following actions
1) I created a dictionary of Textures, so that any time I would do Texture.fromBitmapData, I just looked to see if it was in the texture dictionary. If it was, I returned it, if not I created it. Didn't fix the problem
2) I made sure to dispose of EVERYTHING. I disposed of the root Sprite (starling, of course) that contained everything. I also went through and disposed of every single other Sprite, Image, MovieClip, RenderTexture that I created just to be sure (knowing that the disposal of the root Sprite should have disposed of everything else). I know for a fact that I disposed of every single display object that I created, as I kept reference counts to verify this. Didn't fix the problem
3) I hacked SubTexture to dispose of its parent Texture. This fixed the problem.
Now, maybe I am doing something horribly wrong by making SubTexture dispose of its parent Texture. Maybe I'm doing something horribly wrong such that this is the only thing that I was able to find that fixed the problem. But I'm unable to see where I went wrong. The disposal of the parent Texture makes sure that all Textures are disposed of when I want them to be disposed (re: Reference counting), and I haven't noticed any adverse effects.
The possible conclusions are:
1) I'm horribly misunderstanding the disposal system in Starling, and I was/am doing something extremely wrong. I don't like this conclusion, as I feel that I have been thorough in my search.
2) There is a bug in Starling. I feel like my solution only fixed the symptom of the bug, not the cause. My guess is that for some reason Starling is creating copies of parent textures for SubTextures, hence their need for disposal.
3) Some third option.
Any insight would be helpful. Thanks!