Fix requestRenderAndNotify continuous callback (#3913)

This commit is contained in:
Adrian Cojocaru
2025-10-27 17:04:24 +02:00
committed by GitHub
parent e8c734cd69
commit 512e02410b
3 changed files with 32 additions and 17 deletions

View File

@@ -334,7 +334,15 @@ public abstract class MapLibreSurfaceView extends SurfaceView implements Surface
wantRenderNotification = true;
requestRender = true;
renderComplete = false;
finishDrawingRunnable = finishDrawing;
final Runnable oldCallback = finishDrawingRunnable;
finishDrawingRunnable = () -> {
if (oldCallback != null) {
oldCallback.run();
}
if (finishDrawing != null) {
finishDrawing.run();
}
};
renderThreadManager.notifyAll();
}
@@ -490,7 +498,7 @@ public abstract class MapLibreSurfaceView extends SurfaceView implements Surface
protected ArrayList<Runnable> eventQueue = new ArrayList<>();
protected boolean sizeChanged = true;
protected Runnable finishDrawingRunnable = null;
protected RenderThreadManager renderThreadManager = null;
protected final RenderThreadManager renderThreadManager;
// End of member variables protected by the sRenderThreadManager monitor.
}