corona
corona copied to clipboard
Texture memory (reporting) issue
This was prompted by this comment and some follow-up investigation.
The memory is first incremented here and the corresponding decrement is in WillRemoveTexture()
, just below that. These are the only two places in the code I see the count being modified.
I suspect in this scenario the "size in bytes" is 0 in DidAddTexture()
and only updated when a video has been assigned, leading in turn to the values going negative when the later values are subtracted back out. It seems like this calls for something like a "last known count", at the very least for purposes of WillRemoveTexture()
, but possibly also to keep system.getInfo("textureMemoryUsed")
accurate. Maybe a resync of these values could piggyback on something like invalidate()
.