[gnome-maps] mapView: Invalidate current turn point marker when removed



commit c0502ef5843d6afee284c91be0d635e02d598b32
Author: Marcus Lundblad <ml update uu se>
Date:   Wed Feb 14 22:42:45 2018 +0100

    mapView: Invalidate current turn point marker when removed
    
    Always null out the reference to the current turn point marker
    when removing from instruction layer to avoid destroying an
    already finalized object.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=793472

 src/mapView.js |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/mapView.js b/src/mapView.js
index d5f92b6..db109f6 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -267,12 +267,14 @@ var MapView = GObject.registerClass({
         route.connect('reset', () => {
             this._clearRouteLayers();
             this._instructionMarkerLayer.remove_all();
+            this._turnPointMarker = null;
             this.routeShowing = false;
         });
         transitPlan.connect('update', () => this._showTransitPlan(transitPlan));
         transitPlan.connect('reset', () => {
             this._clearRouteLayers();
             this._instructionMarkerLayer.remove_all();
+            this._turnPointMarker = null;
             this.routeShowing = false;
         });
         transitPlan.connect('itinerary-selected', (obj, itinerary) => {
@@ -282,6 +284,7 @@ var MapView = GObject.registerClass({
         transitPlan.connect('itinerary-deselected', () => {
             this._clearRouteLayers();
             this._instructionMarkerLayer.remove_all();
+            this._turnPointMarker = null;
             this.routeShowing = false;
         });
 
@@ -475,6 +478,7 @@ var MapView = GObject.registerClass({
         if (this._turnPointMarker)
             this._turnPointMarker.destroy();
 
+        this._turnPointMarker = null;
         if (turnPoint.isStop())
             return;
 
@@ -579,6 +583,7 @@ var MapView = GObject.registerClass({
         let pointIndex = 0;
 
         this._instructionMarkerLayer.remove_all();
+        this._turnPointMarker = null;
         route.turnPoints.forEach((turnPoint) => {
             if (turnPoint.isStop()) {
                 let queryPoint = query.filledPoints[pointIndex];
@@ -596,6 +601,7 @@ var MapView = GObject.registerClass({
         this._clearRouteLayers();
         this._placeLayer.remove_all();
         this._instructionMarkerLayer.remove_all();
+        this._turnPointMarker = null;
 
         itinerary.legs.forEach((leg, index) => {
             let dashed = !leg.transit;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]