Skip to content

js/ui: Keep refcounts to WallClock objects above 1

Daniel van Vugt requested to merge vanvugt/gnome-shell:ref-WallClocks into main

Because if you let them bounce between 1 and 2 then they will trigger toggle references every time the object's properties change (maybe every second). Even if you're not subscribed to notify::clock but subscribed to notify::timezone then it's still a problem as the ref/unreffing happens within the GObject notify logic, even if the subscription detail means you don't get those callbacks.

Now because the toggle references on WallClock objects are not toggling down any more, they won't queue the "big hammer" garbage collection to run every 10 seconds (gjs@e9e96955). And CPU spikes from that regular garbage collection (which also caused visible stutter sometimes) are avoided.

Closes: #2085 and #4800

Edited by Daniel van Vugt

Merge request reports