[gtksourceview/master-msvc: 3/4] gtksourceview/*.c: Avoid g_auto*




commit a2b29ba90ad9c1d86883e670a980f15490aeaddb
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Oct 22 11:06:56 2021 +0800

    gtksourceview/*.c: Avoid g_auto*
    
    This way, things will continue to build on Visual Studio.

 gtksourceview/gtksourcebindinggroup.c | 3 ++-
 gtksourceview/gtksourcescheduler.c    | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/gtksourcebindinggroup.c b/gtksourceview/gtksourcebindinggroup.c
index 4d1ccda2..2d4f90b5 100644
--- a/gtksourceview/gtksourcebindinggroup.c
+++ b/gtksourceview/gtksourcebindinggroup.c
@@ -116,7 +116,7 @@ gtk_source_binding_group_connect (GtkSourceBindingGroup *self,
 #ifdef DEBUG_BINDINGS
        {
                GFlagsClass *flags_class;
-               g_autofree gchar *flags_str = NULL;
+               gchar *flags_str = NULL;
 
                flags_class = g_type_class_ref (G_TYPE_BINDING_FLAGS);
                flags_str = _g_flags_to_string (flags_class, lazy_binding->binding_flags);
@@ -130,6 +130,7 @@ gtk_source_binding_group_connect (GtkSourceBindingGroup *self,
                         lazy_binding->target_property,
                         flags_str);
 
+               g_free (flags_str);
                g_type_class_unref (flags_class);
        }
 #endif
diff --git a/gtksourceview/gtksourcescheduler.c b/gtksourceview/gtksourcescheduler.c
index c0d2f5ed..c2ad5eb7 100644
--- a/gtksourceview/gtksourcescheduler.c
+++ b/gtksourceview/gtksourcescheduler.c
@@ -117,11 +117,13 @@ get_interval (GtkSourceScheduler *self)
 
                for (guint i = 0; i < n_items; i++)
                {
-                       g_autoptr(GdkMonitor) monitor = g_list_model_get_item (monitors, i);
+                       GdkMonitor *monitor = g_list_model_get_item (monitors, i);
                        gint64 interval = gdk_monitor_get_refresh_rate (monitor);
 
                        if (interval != 0 && interval < lowest_interval)
                                lowest_interval = interval;
+
+                       g_object_unref (monitor);
                }
 
                self->interval = (double)G_USEC_PER_SEC / (double)lowest_interval * 1000.0;


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