Closed Doppp closed 6 years ago
Ah, yep - this bug was found by @mrcdk!
Oh, yeah. I was waiting for some more testing before making a PR here just in case but, so far, the issue we were having hasn't appeared again so I guess this PR won't cause any issues 😅
I'd suggest making the same PR on the as3 Starling repo, just to keep the behaviour the same. https://github.com/Gamua/Starling-Framework/blob/master/starling/src/starling/textures/RenderTexture.as
Sure, I've done it here, @peteshand. https://github.com/Gamua/Starling-Framework/pull/1043
Does Flash allow you to dispose
twice? Is this an issue with OpenFL's implementation of dispose
?
@jgranick I changed it to remove the dispose
call. AS3 Starling has already merged that into their repo. Refer to: https://github.com/Gamua/Starling-Framework/pull/1043#issuecomment-420265029. @mrcdk maybe we can remove that dispose
call in Haxegon
instead.
No, that's not a good change, if you change the _owsParent
value with https://github.com/openfl/starling/blob/ecd20019e99463168e8c65e3d2fbb2f08ef3cf54/src/starling/textures/SubTexture.hx#L81(it's an internal call but still, we can't be 100% sure it won't happen) you risk disposing the _activeTexture
twice.
@mrcdk PrimaryFeather went further to check for the correct texture to dispose
: https://github.com/Gamua/Starling-Framework/commit/dea6e34b057add5a9fa1ef1629dded2852ea6541 Any thoughts?
From Haxegon, _activeTexture was being disposed twice once in RenderTexture and once in SubTexture. Only dispose it in RenderTexture if SubTexture isn't going to dispose it.