Skip to content

Commit fd1c867

Browse files
committed
gtk.cfg: g_application_get_default is transfer none
See https://docs.gtk.org/gio/type_func.Application.get_default.html
1 parent 2d6f23e commit fd1c867

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

cfg/gtk.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,6 @@
807807
<alloc init="true" no-fail="true">g_app_info_get_default_for_uri_scheme</alloc>
808808
<alloc init="true" no-fail="true">g_application_new</alloc>
809809
<alloc init="true" no-fail="true">g_application_get_dbus_connection</alloc>
810-
<alloc init="true" no-fail="true">g_application_get_default</alloc>
811810
<alloc init="true" no-fail="true">g_buffered_input_stream_new</alloc>
812811
<alloc init="true" no-fail="true">g_buffered_output_stream_new</alloc>
813812
<alloc init="true" no-fail="true">g_cancellable_new</alloc>
@@ -926,6 +925,10 @@
926925
<use>g_file_attribute_matcher_ref</use>
927926
<dealloc>g_file_attribute_matcher_unref</dealloc>
928927
</memory>
928+
<function name="g_application_get_default">
929+
<leak-ignore/>
930+
<noreturn>false</noreturn>
931+
</function>
929932
<function name="g_exit">
930933
<noreturn>true</noreturn>
931934
</function>

test/cfg/gtk.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ void validCode(int argInt, GHashTableIter * hash_table_iter, GHashTable * hash_t
8282
// cppcheck-suppress valueFlowBailout // TODO: caused by <pure/>?
8383
printf("%s", str);
8484
g_free(str);
85+
86+
// transfer none functions: output should not be unreffed
87+
const GApplication *app = g_application_get_default();
88+
printf("%p\n", app);
8589
}
8690

8791
void g_malloc_test()

0 commit comments

Comments
 (0)