Skip to content

Commit

Permalink
MapView: nullify LayerManager on destroy, mapsforge#845
Browse files Browse the repository at this point in the history
  • Loading branch information
devemux86 committed Jul 19, 2016
1 parent 0b386ce commit 8615aee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public LayoutParams(ViewGroup.LayoutParams source) {
private final FrameBufferController frameBufferController;
private final GestureDetector gestureDetector;
private GestureDetector gestureDetectorExternal;
private final LayerManager layerManager;
private LayerManager layerManager;
private final Handler layoutHandler = new Handler();
private MapScaleBar mapScaleBar;
private final MapViewProjection mapViewProjection;
Expand Down Expand Up @@ -171,6 +171,7 @@ public void destroy() {
this.touchGestureHandler.destroy();
this.layoutHandler.removeCallbacksAndMessages(null);
this.layerManager.interrupt();
this.layerManager = null;
this.frameBufferController.destroy();
this.frameBuffer.destroy();
if (this.mapScaleBar != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class MapView extends Container implements org.mapsforge.map.view.MapView
private final FpsCounter fpsCounter;
private final FrameBuffer frameBuffer;
private final FrameBufferController frameBufferController;
private final LayerManager layerManager;
private LayerManager layerManager;
private MapScaleBar mapScaleBar;
private final MapViewProjection mapViewProjection;
private final Model model;
Expand Down Expand Up @@ -95,6 +95,7 @@ public void addLayer(Layer layer) {
@Override
public void destroy() {
this.layerManager.interrupt();
this.layerManager = null;
this.frameBufferController.destroy();
this.frameBuffer.destroy();
if (this.mapScaleBar != null) {
Expand Down

0 comments on commit 8615aee

Please sign in to comment.