内存泄漏问题优化
This commit is contained in:
@@ -76,7 +76,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
|
||||
private static final String TAG = "AMapNaviViewWrapper";
|
||||
|
||||
private final AMapNaviView mMapView;
|
||||
private AMapNaviView mMapView;
|
||||
private IMogoMap mIMap;
|
||||
|
||||
private AMapMarkerClickHandler mMarkerClickHandler;
|
||||
@@ -239,8 +239,10 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
public void onDestroy() {
|
||||
if ( mMapView != null ) {
|
||||
mMapView.onDestroy();
|
||||
mMapView = null;
|
||||
AMapUIController.release();
|
||||
AMapWrapper.release();
|
||||
AMapMessageManager.getInstance().unregisterAMapMessageListener( this );
|
||||
Logger.d( TAG, "map onDestroy" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,6 +367,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mMogoStatusManager.setMainPageLaunchedStatus( TAG, false );
|
||||
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, false );
|
||||
mMogoFragmentManager.unregisterMainFragmentStackTransactionListener();
|
||||
mMogoFragmentManager.destroy();
|
||||
mMogoFragmentManager = null;
|
||||
mServiceApis.getMapServiceApi().getMapViewInstanceHandler().destroy();
|
||||
mServiceApis.getMapServiceApi().getMapUIController().destroy();
|
||||
|
||||
@@ -78,4 +78,6 @@ public interface IMogoFragmentManager extends IProvider {
|
||||
void initMessageHistoryContainerId( int layoutId );
|
||||
|
||||
int getMessageHistoryContainerId();
|
||||
|
||||
void destroy();
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class FragmentStack {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
public static synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@@ -201,4 +201,8 @@ public class FragmentStack {
|
||||
}
|
||||
invokeCallback();
|
||||
}
|
||||
|
||||
public void destroy(){
|
||||
mFragmentManager = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,11 @@ public class MogoFragmentManager implements IMogoFragmentManager {
|
||||
return FragmentStack.getInstance().getMessageHistoryContainerId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
FragmentStack.getInstance().destroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user