misc: Don't call disconnectAll on token proxy objects

The disconnectAll method is a method available to javascript]
objects that want gobject-ish signal handling features.

It is not a method available to GObjects come from introspection.

"token" objects in the smartcard manager code are just plain old
GDBusProxy objects and so don't have disconnectAll methods.

This commit changes the code to use a direct disconnect call for
the one pertinent signal connection instead.
This commit is contained in:
Ray Strode 2024-02-09 13:14:39 -05:00
parent 4598d7aa5f
commit 2391497f60

View file

@ -78,7 +78,7 @@ class SmartcardManager extends Signals.EventEmitter {
_addToken(token) { _addToken(token) {
this._updateToken(token); this._updateToken(token);
token.connect('g-properties-changed', (proxy, properties) => { token._smartcardSignalId = token.connect('g-properties-changed', (proxy, properties) => {
const isInsertedChanged = !!properties.lookup_value('IsInserted', null); const isInsertedChanged = !!properties.lookup_value('IsInserted', null);
if (isInsertedChanged) { if (isInsertedChanged) {
this._updateToken(token); this._updateToken(token);
@ -103,10 +103,13 @@ class SmartcardManager extends Signals.EventEmitter {
this.emit('smartcard-removed', token); this.emit('smartcard-removed', token);
} }
if (token._smartcardSignalId) {
token.disconnect(token._smartcardSignalId);
delete token._smartcardSignalId;
}
if (this._loginToken === token) if (this._loginToken === token)
this._loginToken = null; this._loginToken = null;
token.disconnectAll();
} }
hasInsertedTokens() { hasInsertedTokens() {