[android] gl surfaceview renderer - only destroy context when destroying the mapview
This commit is contained in:
committed by
Ivo van Dongen
parent
96fef8172b
commit
fee22273be
@@ -25,6 +25,8 @@ public class GLSurfaceViewMapRenderer extends MapRenderer implements GLSurfaceVi
|
||||
@NonNull
|
||||
private final GLSurfaceView glSurfaceView;
|
||||
|
||||
private boolean requestDestroy;
|
||||
|
||||
public GLSurfaceViewMapRenderer(Context context,
|
||||
GLSurfaceView glSurfaceView,
|
||||
String localIdeographFontFamily) {
|
||||
@@ -40,7 +42,7 @@ public class GLSurfaceViewMapRenderer extends MapRenderer implements GLSurfaceVi
|
||||
|
||||
@Override
|
||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||
GLSurfaceViewMapRenderer.this.onSurfaceDestroyed();
|
||||
requestDestroy = true;
|
||||
}
|
||||
|
||||
});
|
||||
@@ -51,11 +53,29 @@ public class GLSurfaceViewMapRenderer extends MapRenderer implements GLSurfaceVi
|
||||
glSurfaceView.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (requestDestroy) {
|
||||
onSurfaceDestroyed();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
glSurfaceView.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
|
||||
super.onSurfaceCreated(gl, config);
|
||||
|
||||
Reference in New Issue
Block a user