GNOME Bugzilla – Bug 703960
Interfaces are leaked when retrieving enums and flags
Last modified: 2013-07-10 22:41:36 UTC
g_type_info_get_interface is called in several places when calling functions that return flags or enums. The returned interface should be freed with g_base_info_unref. The leaks can be seen when running make check.valgrind if G_DEBUG is set to always-malloc.
Created attachment 248853 [details] [review] Patch. Add calls to g_base_info_unref() in a bunch of places.
Review of attachment 248853 [details] [review]: Thanks for this. One potential problem described below: ::: gi/pygi-marshal-from-py.c @@ +1631,3 @@ } + ret = TRUE; Won't this always clobber the ret value with TRUE even after it is set in error case above? I'd be fine with either an explicit call to unref in the error case or moving "ret = TRUE" closer to where the variable is declared.
Created attachment 248883 [details] [review] Updated patch. Good catch. I've just added an unref in the error case and removed the variable.
Looks good now, thanks!