Skip to content
Snippets Groups Projects

gibaseinfo: Fix use of stack-allocated GIBaseInfos

All threads resolved!

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
  • Philip Withnall added 1 commit

    added 1 commit

    • 9b5d008f - girffi: Rename gi_function_invoker_destroy() to …_clear()

    Compare with previous version

  • Philip Withnall resolved all threads

    resolved all threads

  • Philip Withnall enabled an automatic merge when the pipeline for 9b5d008f succeeds

    enabled an automatic merge when the pipeline for 9b5d008f succeeds

  • Philip Withnall mentioned in commit 01e19786

    mentioned in commit 01e19786

  • Philip Withnall mentioned in merge request !3843 (merged)

    mentioned in merge request !3843 (merged)

  • Please register or sign in to reply
    Loading