signalTracker: Clear all signal trackers on shutdown

This avoids a lot of otherwise invalid signal handler invokations if we
would later attempt to terminate the gjs and mutter context.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1349>
This commit is contained in:
Jonas Ådahl 2022-08-17 16:30:07 +02:00
parent f6a5093c09
commit 411360cd1b

View File

@ -43,6 +43,12 @@ class SignalManager {
constructor() {
this._signalTrackers = new Map();
global.connect_after('shutdown', () => {
[...this._signalTrackers.values()].forEach(
tracker => tracker.destroy());
this._signalTrackers.clear();
});
}
/**