|
@@ -338,6 +338,14 @@ public class JmeSurfaceView extends RelativeLayout implements SystemListener, Di
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void removeGlSurfaceView() {
|
|
|
|
+ ((Activity)getContext()).runOnUiThread(() -> {
|
|
|
|
+ if (glSurfaceView != null) {
|
|
|
|
+ JmeSurfaceView.this.removeView(glSurfaceView);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
//******************Overridden methods by the implemented interfaces************************
|
|
//******************Overridden methods by the implemented interfaces************************
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -503,6 +511,7 @@ public class JmeSurfaceView extends RelativeLayout implements SystemListener, Di
|
|
if (legacyApplication == null) {
|
|
if (legacyApplication == null) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ removeGlSurfaceView();
|
|
legacyApplication.destroy();
|
|
legacyApplication.destroy();
|
|
/*help the Dalvik Garbage collector to destruct the pointers, by making them nullptr*/
|
|
/*help the Dalvik Garbage collector to destruct the pointers, by making them nullptr*/
|
|
/*context instances*/
|
|
/*context instances*/
|
|
@@ -510,7 +519,6 @@ public class JmeSurfaceView extends RelativeLayout implements SystemListener, Di
|
|
appSettings = null;
|
|
appSettings = null;
|
|
oglesContext = null;
|
|
oglesContext = null;
|
|
configurationInfo = null;
|
|
configurationInfo = null;
|
|
- glSurfaceView = null;
|
|
|
|
/*extra data instances*/
|
|
/*extra data instances*/
|
|
crashLogWriter = null;
|
|
crashLogWriter = null;
|
|
crashLog = null;
|
|
crashLog = null;
|
|
@@ -970,4 +978,4 @@ public class JmeSurfaceView extends RelativeLayout implements SystemListener, Di
|
|
public boolean isShowErrorDialog() {
|
|
public boolean isShowErrorDialog() {
|
|
return showErrorDialog;
|
|
return showErrorDialog;
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|