GNOME Bugzilla – Bug 736517
Memory leaks in GI regress and marshalling tests
Last modified: 2018-02-08 12:29:48 UTC
A handful of leaks are showing up in pygi unittests when run through valgrind due to leaky tests in both gimarshallingtests.c and regress.c. Patches to follow.
Created attachment 285970 [details] [review] tests: Unref async result after adding to idle callback g_simple_async_result_complete_in_idle() will add its own reference for managing the async result. We need to unref the result after calling this so we don't leak.
Created attachment 285971 [details] [review] tests: Free input array in test_array_int_inout() Transfer is annotated as full so the function should free its input.
Created attachment 285972 [details] [review] tests: Usage a single allocation for test_ghash_gvalue_return Use a single static allocation for the hash created in regress_test_ghash_gvalue_return(). This function is explicitly marked as returning the hash with transfer-none and doesn't need to re-create the hash each call.
Review of attachment 285970 [details] [review]: okay.
Review of attachment 285971 [details] [review]: okay.
Review of attachment 285972 [details] [review]: ::: tests/scanner/regress.c @@ +1258,1 @@ + if (hash == NULL) { coding style: new line before the curly brace.
Created attachment 285977 [details] [review] tests: Free input string in regress_test_utf8_inout() Transfer is annotated as full so the function should free its input after testing and before output assignment.
Review of attachment 285977 [details] [review]: looks good.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Fixed up the style issue, an pushed all 4 of these patches. Thanks!
The "tests: Free input string in regress_test_utf8_inout()" patch breaks the "everythingBasic.js" test in GJS. Haven't yet looked whether this is a GJS bug or a gobject-introspection one though.
Still an issue
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/114.