gibaseinfo: Fix use of stack-allocated GIBaseInfos
Most of the code for handling stack-allocated infos was correct, it was
just missing code to initialise the GTypeInstance
member.
Since GTypeInstance
isn’t really designed for stack allocation, this
is a little hacky — it requires setting up the member within
GTypeInstance
manually. It works, though.
The externally visible consequence of this, though, is that
stack-allocated GIBaseInfo
s now need to be cleared when they’re
finished being used. This allows the GTypeClass
ref to be dropped.
All users of the stack-allocated APIs in libgirepository will need to adapt to this change.
Signed-off-by: Philip Withnall pwithnall@gnome.org
Fixes: #3218 (closed)
Merge request reports
Activity
changed milestone to %2.79.2
added 1. Crash API break GIRepository labels
assigned to @pwithnall
mentioned in issue #3218 (closed)
mentioned in issue #3217 (closed)
- Resolved by Philip Withnall
This should really build on the test-common work done in !3843 (merged), but that hasn’t landed yet. I expect it will land first, in which case I’ll rework the new test here to use the common code pulled out there. But this is good to review in the meantime; those changes won’t make a difference to the approach used in this MR.
Edited by Philip Withnall
- Resolved by Philip Withnall
added 1 commit
- 9b5d008f - girffi: Rename gi_function_invoker_destroy() to …_clear()
enabled an automatic merge when the pipeline for 9b5d008f succeeds
mentioned in commit 01e19786
mentioned in merge request !3843 (merged)