Fix memory handling of caller-allocated boxed types
_pygi_marshal_to_py_interface_struct() and other places treat subtypes of G_TYPE_BOXED as boxed values and wrap them with _pygi_boxed_new(). Fix _caller_alloc() and _cleanup_caller_allocates() to consider G_TYPE_BOXED subtypes as well and use the slice allocator instead of malloc()'ing a struct. This avoids trying to free an malloc'ed struct with g_slice_free() and properly cleans up the boxed values. The leak was produced with: G_SLICE=debug-blocks PYTHONPATH=. valgrind --tool=memcheck --leak-check=full --show-possibly-lost=no \ python3 -c 'from gi.repository import Gtk; b=Gtk.TextBuffer(); (s,e) = b.get_bounds()'
Showing with 2 additions and 2 deletions