Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • W wireplumber
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 142
    • Issues 142
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PipeWirePipeWire
  • wireplumber
  • Merge requests
  • !157

object: use weakref when advancing current transition

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Julian Bouzas requested to merge julian/wireplumber:memleak-fix into master Jun 01, 2021
  • Overview 2
  • Commits 2
  • Pipelines 1
  • Changes 1

Fixes reference count leak when activating an object and transition fails. The leak can be seen with valgrind when running the session item activate-error unit test:

valgrind --suppressions=/usr/share/glib-2.0/valgrind/glib.supp --leak-check=full ./build/tests/wp/test-session-item -p activation-error

When wp_transition_return_error() is called, the transition is never removed from the object's transitions queue. When that happens, the object will never be destroyed because the transition also holds a strong reference of the object.

To solve this leak, the transitions are now stored in a weak reference before advancing them, and they will be removed from the transition queue once the weak reference is null or the transition has been completed.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: memleak-fix