From 4856166c21e96c7118de1055feb51f20bd7a6f40 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Fri, 24 Jun 2022 11:56:29 +0800 Subject: 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(-) (limited to 'testsuite') 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); -- cgit v1.2.1