[libshumate] view: Stop using GSlice
- From: Corentin Noël <corentinnoel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libshumate] view: Stop using GSlice
- Date: Fri, 5 Mar 2021 13:23:16 +0000 (UTC)
commit e1ff5bead5caea9bf8803bb23c73ebd41f37a3e3
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Mar 4 21:33:07 2021 -0300
view: Stop using GSlice
It is semi-officially deprecated. Also sneak in a small cleanup
using g_clear_pointer().
shumate/shumate-view.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/shumate/shumate-view.c b/shumate/shumate-view.c
index 3d9c338..fd4c9da 100644
--- a/shumate/shumate-view.c
+++ b/shumate/shumate-view.c
@@ -469,7 +469,7 @@ shumate_view_go_to_with_duration (ShumateView *view,
shumate_view_stop_go_to (view);
- ctx = g_slice_new (GoToContext);
+ ctx = g_new (GoToContext, 1);
ctx->start_us = g_get_monotonic_time ();
ctx->duration_us = ms_to_us (duration_ms);
ctx->from_latitude = shumate_location_get_latitude (SHUMATE_LOCATION (priv->viewport));
@@ -903,8 +903,7 @@ shumate_view_stop_go_to (ShumateView *view)
return;
gtk_widget_remove_tick_callback (GTK_WIDGET (view), priv->goto_context->tick_id);
- g_slice_free (GoToContext, priv->goto_context);
- priv->goto_context = NULL;
+ g_clear_pointer (&priv->goto_context, g_free);
g_signal_emit (view, signals[ANIMATION_COMPLETED], go_to_quark, NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]