[gnome-maps] Don't forget to disconnect 'animation-completed' signal



commit c235b4750260db0b8f97a079a332bf9da87dba92
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sun Mar 31 05:31:58 2013 +0300

    Don't forget to disconnect 'animation-completed' signal
    
    This fixes a regression from baa87cb9 that made us zoom each time there
    was an animation on the map view.

 src/mapView.js |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/mapView.js b/src/mapView.js
index c9a3be1..7374be9 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -65,13 +65,14 @@ const MapView = new Lang.Class({
 
             let zoom = Utils.getZoomLevelForAccuracy(accuracy);
             this._view.go_to(location.latitude, location.longitude);
-            this._view.connect("animation-completed::go-to", Lang.bind(this,
+            let anim_completed_id = this._view.connect("animation-completed::go-to", Lang.bind(this,
                 function() {
                     // Apparently the signal is called before animation is really complete so if we don't
                     // zoom in idle, we get a crash. Perhaps a bug in libchamplain?
                     Mainloop.idle_add(Lang.bind(this,
                         function() {
                             this._view.set_zoom_level(zoom);
+                            this._view.disconnect(anim_completed_id);
                         }));
                 }));
         } catch (e) {


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