[libadwaita] spring-params: Stop using GSlice



commit faa98b9a73e8b683a8f3f0cd2473f7b71c8a3c83
Author: Fernando Monteiro <fr02monteiro gmail com>
Date:   Mon Apr 25 14:29:28 2022 +0100

    spring-params: Stop using GSlice
    
    GSlice has been inofficially deprecated for years, is known to
    cause issues with valgrind and potentially hides memory corruption
    so lets stop using it.

 src/adw-spring-params.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/adw-spring-params.c b/src/adw-spring-params.c
index 0cc3ed3b..a49a6710 100644
--- a/src/adw-spring-params.c
+++ b/src/adw-spring-params.c
@@ -126,7 +126,7 @@ adw_spring_params_new_full (double damping,
   g_return_val_if_fail (mass > 0.0, NULL);
   g_return_val_if_fail (stiffness > 0.0, NULL);
 
-  self = g_slice_new0 (AdwSpringParams);
+  self = g_new0 (AdwSpringParams, 1);
 
   g_atomic_ref_count_init (&self->ref_count);
 
@@ -173,7 +173,7 @@ adw_spring_params_unref (AdwSpringParams *self)
   g_return_if_fail (self != NULL);
 
   if (g_atomic_ref_count_dec (&self->ref_count))
-    g_slice_free (AdwSpringParams, self);
+    g_free (self);
 }
 
 /**


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