Skip to content
Commit 91ce5ca9 authored by Sebastian Keller's avatar Sebastian Keller Committed by Marge Bot
Browse files

signalTracker: Remove SignalTracker after its last signal got untracked

The object the SignalTracker belongs to is stored in a map managed by
the SignalManager which keeps a reference to that object. This map is
never destroyed nor is any entry ever removed. This leads to all objects
that ever had SignalTrackers used on them being kept alive even after
all references outside of the SignalTracker are long gone. This then
also extends to other objects which are leaked indirectly through
reference chains from these objects.

And if some of those objects are GObjects, this will prevent them from
being finalized, leaking further resources. A StWidget for example will
not release its shadow textures.

Fix this by destroying the SignalTracker and removing it from the
SignalManager once the last signal it was tracking has been untracked.

A WeakMap could have been used as well, but we need the Map to be
iterable in some of the following changes.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5807
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5796
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2466>
parent 54ee728a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment