[CrashFix]修正地图清标记是引发的空指针

This commit is contained in:
renwj
2022-11-03 19:04:49 +08:00
parent 592e7a90c8
commit 46106aab9e

View File

@@ -77,11 +77,13 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
mMogoMarkerOptions.deleteObservers();
mMogoMarkerOptions = null;
}
if ( mMarker != null ) {
mMarker.remove();
mMarker.setMObject( null );
mMarker.setOnInfoWindowClickListener( null );
mMarker = null;
synchronized (this) {
if ( mMarker != null ) {
mMarker.remove();
mMarker.setMObject( null );
mMarker.setOnInfoWindowClickListener( null );
mMarker = null;
}
}
mMogoInfoWindowAdapter = null;
mMogoMarkerClickListener = null;