From c9669119f05d0d62384e193fd54845ab94709564 Mon Sep 17 00:00:00 2001 From: Alex Cristici Date: Mon, 7 Oct 2024 16:09:40 +0300 Subject: [PATCH] Android 10 glThreadManager changed to non static (#2901) --- .../maps/renderer/glsurfaceview/MapboxGLSurfaceView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/glsurfaceview/MapboxGLSurfaceView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/glsurfaceview/MapboxGLSurfaceView.java index 27f90be3a59..8ea667bb7e0 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/glsurfaceview/MapboxGLSurfaceView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/glsurfaceview/MapboxGLSurfaceView.java @@ -33,7 +33,7 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Callback2 { private static final String TAG = "GLSurfaceView"; - private static final GLThreadManager glThreadManager = new GLThreadManager(); + private final GLThreadManager glThreadManager = new GLThreadManager(); private final WeakReference viewWeakReference = new WeakReference<>(this); private GLThread glThread; @@ -558,6 +558,7 @@ static class GLThread extends Thread { renderMode = RENDERMODE_CONTINUOUSLY; wantRenderNotification = false; mGLSurfaceViewWeakRef = glSurfaceViewWeakRef; + glThreadManager = glSurfaceViewWeakRef.get().glThreadManager; } @Override @@ -1041,6 +1042,7 @@ public void queueEvent(@NonNull Runnable r) { private ArrayList eventQueue = new ArrayList<>(); private boolean sizeChanged = true; private Runnable finishDrawingRunnable = null; + private GLThreadManager glThreadManager = null; // End of member variables protected by the sGLThreadManager monitor. private EglHelper eglHelper;