[gimp] libgimpwidgets: Stop using deprecated APIs



commit edc719c0043f420d243dd81108843f279dfda7aa
Author: Ondřej Míchal <harrymichal seznam cz>
Date:   Sat Oct 16 16:41:03 2021 +0300

    libgimpwidgets: Stop using deprecated APIs
    
    The minimum required version of GLib is still 2.68.

 libgimpwidgets/gimpscaleentry.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/libgimpwidgets/gimpscaleentry.c b/libgimpwidgets/gimpscaleentry.c
index 67b2e6e4ef..29dec082f3 100644
--- a/libgimpwidgets/gimpscaleentry.c
+++ b/libgimpwidgets/gimpscaleentry.c
@@ -150,7 +150,7 @@ gimp_scale_entry_linear_to_log (GBinding     *binding,
   GtkAdjustment *spin_adjustment;
   gdouble        value = g_value_get_double (from_value);
 
-  spin_adjustment = GTK_ADJUSTMENT (g_binding_get_source (binding));
+  spin_adjustment = GTK_ADJUSTMENT (g_binding_dup_source (binding));
 
   if (gtk_adjustment_get_lower (spin_adjustment) <= 0.0)
     value = log (value - gtk_adjustment_get_lower (spin_adjustment) + 0.1);
@@ -159,6 +159,8 @@ gimp_scale_entry_linear_to_log (GBinding     *binding,
 
   g_value_set_double (to_value, value);
 
+  g_clear_object (&spin_adjustment);
+
   return TRUE;
 }
 
@@ -171,7 +173,7 @@ gimp_scale_entry_log_to_linear (GBinding     *binding,
   GtkAdjustment *spin_adjustment;
   gdouble        value = g_value_get_double (from_value);
 
-  spin_adjustment = GTK_ADJUSTMENT (g_binding_get_source (binding));
+  spin_adjustment = GTK_ADJUSTMENT (g_binding_dup_source (binding));
 
   value = exp (value);
 
@@ -180,6 +182,8 @@ gimp_scale_entry_log_to_linear (GBinding     *binding,
 
   g_value_set_double (to_value, value);
 
+  g_clear_object (&spin_adjustment);
+
   return TRUE;
 }
 


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