Skip to content
Snippets Groups Projects

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 GIBaseInfos 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)

Edited by Marco Trevisan

Merge request reports

Pipeline #625970 passed with warnings

Pipeline passed with warnings for 9b5d008f on pwithnall:3218-girepository-stack-allocations

Test coverage 80.10% from 1 job

Merged by Philip WithnallPhilip Withnall 1 year ago (Jan 23, 2024 11:08pm UTC)

Merge details

Pipeline #625978 passed

Pipeline passed for 01e19786 on main

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading