[gnome-maps] turnPointMarker: Avoid signal callback on finallized instance



commit 8374cd6dfe693c293747292f7f18134ede143f46
Author: Marcus Lundblad <ml update uu se>
Date:   Wed Feb 14 22:49:17 2018 +0100

    turnPointMarker: Avoid signal callback on finallized instance
    
    Avoid running the animation complete callback on a finallized
    instance by capturing the needed variables (latitude and longitude)
    in the local scope.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=793472

 src/turnPointMarker.js |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/turnPointMarker.js b/src/turnPointMarker.js
index 6565937..ef81049 100644
--- a/src/turnPointMarker.js
+++ b/src/turnPointMarker.js
@@ -98,14 +98,15 @@ class TurnPointMarker extends MapMarker.MapMarker {
     goTo() {
         let view = this._mapView.view;
         let turnPointZoomLevel = 15;
+        let latitude = this.latitude;
+        let longitude = this.longitude;
 
         view.goto_animation_mode = Clutter.AnimationMode.LINEAR;
         view.goto_duration = 0;
 
         Utils.once(view, 'animation-completed', () => {
             view.zoom_level = turnPointZoomLevel;
-            view.center_on(this.latitude,
-                           this.longitude);
+            view.center_on(latitude, longitude);
         });
 
         view.go_to(this.latitude, this.longitude);


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