path: root/vcl/source
diff options
authorTomaž Vajngerl <>2016-06-08 19:07:46 +0900
committerTomaž Vajngerl <>2016-06-08 19:35:45 +0900
commit8dcf60ecbe9c159831ece3b6201882f1d0033472 (patch)
treecfcfc0db0a7896e247eb8752624cc62ae2a7f578 /vcl/source
parent6cd3882bec5aa63b61d7cc9db66ff3bae5d43f1c (diff)
tdf#100184 fix the lifecycle of a texture in an atlas
Previously, when a texture atlas was destroyed we teared down the ImplOpenGLTexture even if there were OpenGLTexture instances around. This caused that we could try to access an already deallocated ImplOpenGLTexture which causes a seg. fault. Now we change this so that a FixedTexture is no different than a OpenGLTexture - we just release the reference, so any existing OpenGLTextures for our texture would still be valid. An additional problem is that FixedTexture registers a callback for slot deallocation so we know when a OpenGLTextures that holds a specific "slot" on the texture is deallocated. However if FixedTexture is not existent anymore, the callback still gets triggered and is trying to access invalid memory. To solve this we need to unregister callbacks before FixedTexture is destroyed. Additionally improve validity of a OpenGLTexture is valid. If ImplOpenGLTexture is not allocated (nullptr) is one case, but in addition to that if ImplOpenGLTexture has an id == 0 it also means that it is not valid (anymore). Change-Id: I87346198e8928e112619da62687d5856cb8aafb8
Diffstat (limited to 'vcl/source')
0 files changed, 0 insertions, 0 deletions