Sync surface destruction with main thread (#3368)

This commit is contained in:
Adrian Cojocaru
2025-04-09 14:58:10 +03:00
committed by GitHub
parent d693898757
commit 802586ed52
3 changed files with 20 additions and 0 deletions

View File

@@ -23,6 +23,8 @@ public class VulkanTextureViewRenderThread extends TextureViewRenderThread {
mapRenderer.onSurfaceDestroyed();
surface.release();
surface = null;
hasNativeSurface = false;
}
// Thread implementation
@@ -68,6 +70,7 @@ public class VulkanTextureViewRenderThread extends TextureViewRenderThread {
if (surface == null) {
surface = new Surface(surfaceTexture);
this.hasNativeSurface = true;
createSurface = true;
}
@@ -111,6 +114,10 @@ public class VulkanTextureViewRenderThread extends TextureViewRenderThread {
if (destroySurface) {
mapRenderer.onSurfaceDestroyed();
destroySurface = false;
synchronized (lock) {
this.hasNativeSurface = false;
lock.notifyAll();
}
continue;
}