Sync surface destruction with main thread (#3368)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user