Make sure renderThread is alive before calling requestExitAndWait() (#3461)
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
# Changelog MapLibre Native for Android
|
||||
|
||||
## main
|
||||
## 11.8.8
|
||||
|
||||
### ✨ Features and improvements
|
||||
|
||||
- Update NDK to 28.1.13356709 ([#3450](https://github.com/maplibre/maplibre-native/pull/3450)).
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
- Make sure renderThread is alive before calling requestExitAndWait() ([#3461](https://github.com/maplibre/maplibre-native/pull/3461)).
|
||||
|
||||
## 11.8.7
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=11.8.7
|
||||
VERSION_NAME=11.8.8
|
||||
|
||||
# Only build native dependencies for the current ABI
|
||||
# See https://code.google.com/p/android/issues/detail?id=221098#c20
|
||||
|
||||
@@ -51,7 +51,7 @@ public abstract class MapLibreSurfaceView extends SurfaceView implements Surface
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
try {
|
||||
if (renderThread != null) {
|
||||
if (renderThread != null && renderThread.isAlive()) {
|
||||
// thread may still be running if this view was never
|
||||
// attached to a window.
|
||||
renderThread.requestExitAndWait();
|
||||
@@ -249,7 +249,7 @@ public abstract class MapLibreSurfaceView extends SurfaceView implements Surface
|
||||
if (detachedListener != null) {
|
||||
detachedListener.onSurfaceViewDetached();
|
||||
}
|
||||
if (renderThread != null) {
|
||||
if (renderThread != null && renderThread.isAlive()) {
|
||||
renderThread.requestExitAndWait();
|
||||
}
|
||||
detached = true;
|
||||
@@ -435,9 +435,9 @@ public abstract class MapLibreSurfaceView extends SurfaceView implements Surface
|
||||
synchronized (renderThreadManager) {
|
||||
shouldExit = true;
|
||||
renderThreadManager.notifyAll();
|
||||
while (!exited) {
|
||||
while (!exited && this.isAlive()) {
|
||||
try {
|
||||
renderThreadManager.wait();
|
||||
renderThreadManager.wait(100);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user