]> err.no Git - libchamplain/commitdiff
Stop any ongoing animation before disposing
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Sat, 13 Jun 2009 20:27:52 +0000 (16:27 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Sat, 13 Jun 2009 20:27:52 +0000 (16:27 -0400)
champlain/champlain-view.c
tidy/tidy-adjustment.c
tidy/tidy-adjustment.h
tidy/tidy-viewport.c
tidy/tidy-viewport.h

index 5ca635e6adf96c9131ea04f79db1cafb1582d6eb..795813661620fc95c317932873762e533671d1a0 100644 (file)
@@ -649,12 +649,14 @@ champlain_view_dispose (GObject *object)
 
   if (priv->finger_scroll != NULL)
     {
+      tidy_finger_scroll_stop (TIDY_FINGER_SCROLL (priv->finger_scroll));
       g_object_unref (priv->finger_scroll);
       priv->finger_scroll = NULL;
     }
 
   if (priv->viewport != NULL)
     {
+      tidy_viewport_stop (TIDY_VIEWPORT (priv->viewport));
       g_object_unref (priv->viewport);
       priv->viewport = NULL;
     }
index 82fe95c09885efa96fe9c84746496e48d3fb4374..3e14a53c3f3e6f195187de814d5e691c4108a479 100644 (file)
@@ -197,6 +197,12 @@ stop_interpolation (TidyAdjustment *adjustment)
     }
 }
 
+void
+tidy_adjustment_interpolate_stop (TidyAdjustment *adjustment)
+{
+  stop_interpolation (adjustment);
+}
+
 static void
 tidy_adjustment_dispose (GObject *object)
 {
@@ -754,7 +760,7 @@ tidy_adjustment_interpolatex (TidyAdjustment *adjustment,
   TidyAdjustmentPrivate *priv = adjustment->priv;
 
   stop_interpolation (adjustment);
-  
+
   if (n_frames <= 1)
     {
       tidy_adjustment_set_valuex (adjustment, value);
@@ -763,7 +769,7 @@ tidy_adjustment_interpolatex (TidyAdjustment *adjustment,
 
   priv->old_position = priv->value;
   priv->new_position = value;
-  
+
   priv->dx = clutter_qdivx (priv->new_position - priv->old_position,
                             CLUTTER_INT_TO_FIXED (n_frames));
   priv->interpolation = clutter_timeline_new (n_frames, fps);
index cd5104927dd708e12b8ced3f9ce3bd168b502036..98f531e1289533c0ea43f59fab3906ccd2cad685 100644 (file)
@@ -141,6 +141,7 @@ gboolean        tidy_adjustment_clamp        (TidyAdjustment *adjustment,
                                               gboolean        interpolate,
                                               guint           n_frames,
                                               guint           fps);
+void            tidy_adjustment_interpolate_stop (TidyAdjustment *adjustment);
 
 G_END_DECLS
 
index 33602e0ccde3c597d825b8de3d62fadb7becf79d..47dddf0f4a69fba8fd84c565d77bf5b4804d2490 100644 (file)
@@ -160,7 +160,7 @@ tidy_viewport_set_property (GObject      *object,
                                   priv->hadjustment,
                                   g_value_get_object (value));
       break;
-    
+
     case PROP_SYNC_ADJUST :
       priv->sync_adjustments = g_value_get_boolean (value);
       break;
@@ -171,19 +171,30 @@ tidy_viewport_set_property (GObject      *object,
     }
 }
 
+void
+tidy_viewport_stop (TidyViewport *viewport)
+{
+  TidyViewportPrivate *priv = TIDY_VIEWPORT (viewport)->priv;
+
+  tidy_adjustment_interpolate_stop (priv->hadjustment);
+  tidy_adjustment_interpolate_stop (priv->vadjustment);
+}
+
 static void
 tidy_viewport_dispose (GObject *gobject)
 {
   TidyViewportPrivate *priv = TIDY_VIEWPORT (gobject)->priv;
-  
+
   if (priv->hadjustment)
     {
+      tidy_adjustment_interpolate_stop (priv->hadjustment);
       g_object_unref (priv->hadjustment);
       priv->hadjustment = NULL;
     }
 
   if (priv->vadjustment)
     {
+      tidy_adjustment_interpolate_stop (priv->vadjustment);
       g_object_unref (priv->vadjustment);
       priv->vadjustment = NULL;
     }
index eb457bfbbec18e84b26a698bf826b8d5db4e1a42..2278367a602a23871d4509ad4eb1199a4eba0ad9 100644 (file)
@@ -74,6 +74,7 @@ void           tidy_viewport_get_origin  (TidyViewport *viewport,
                                           gint         *x,
                                           gint         *y,
                                           gint         *z);
+void           tidy_viewport_stop        (TidyViewport *viewport);
 
 G_END_DECLS