[gtksourceview/msvc-meson-cleanups: 3/3] test-snippets.c: Fix build on Visual Studio




commit 4856166c21e96c7118de1055feb51f20bd7a6f40
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Jun 24 11:56:29 2022 +0800

    test-snippets.c: Fix build on Visual Studio
    
    There is sadly no support for g_autoptr() on Visual Studio at this time.
    Hopefully things will change if Jussi's proposal gets accepted eventually[1].
    
    [1]: 
https://developercommunity.visualstudio.com/t/add-support-for-gcc-like-cleanup-attribute-for-pla/1187001

 testsuite/test-snippets.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/testsuite/test-snippets.c b/testsuite/test-snippets.c
index 36112622..f30d3ca7 100644
--- a/testsuite/test-snippets.c
+++ b/testsuite/test-snippets.c
@@ -71,11 +71,13 @@ test_snippet_fetching (void)
        /* Test language id for snippets */
        for (guint i = 0; i < n_items; i++)
        {
-               g_autoptr(GtkSourceSnippet) snippet = g_list_model_get_item (model, i);
+               GtkSourceSnippet *snippet = g_list_model_get_item (model, i);
                const char *language_id = gtk_source_snippet_get_language_id (snippet);
 
                g_assert_nonnull (language_id);
                g_assert_cmpstr (language_id, !=, "");
+
+               g_object_unref (snippet);
        }
 
        g_assert_finalize_object (mgr);


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