Improve handling of boxed types #255

Merged
jwharm merged 3 commits from free-boxed-types into main 2025-07-30 22:03:11 +02:00
jwharm commented 2025-07-30 22:02:59 +02:00 (Migrated from github.com)

Copy and free actions for structs was not always working correctly, because Java-GI incorrectly assumed all structs with a get_type() function are boxed types. This PR adds a new utility class for working with boxed types, BoxedUtil, and uses it to:

  • check if a struct is boxed
  • copy a struct, using g_boxed_copy if it is a boxed type without a known copy-function
  • free a struct, using g_boxed_free if it is a boxed type without a known free-function
Copy and free actions for structs was not always working correctly, because Java-GI incorrectly assumed all structs with a `get_type()` function are boxed types. This PR adds a new utility class for working with boxed types, `BoxedUtil`, and uses it to: - check if a struct is boxed - copy a struct, using `g_boxed_copy` if it is a boxed type without a known copy-function - free a struct, using `g_boxed_free` if it is a boxed type without a known free-function
Sign in to join this conversation.
No description provided.