From 8431e7ae51fb9007a815f8e72592df529ce44ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Mon, 3 Apr 2023 16:12:59 +0200 Subject: [PATCH] misc/objectManager: Fix emission of object-removed signal Emitting this signal is broken right now: We check for a length of 0 on this._objects[objectPath], but the `this._objects[objectPath][interfaceName] = null` we do before the check doesn't actually remove the key, it only sets the value to null, leaving the key around and thus the amount of entries in the object doesn't change. Fix that by using the delete statement instead, "delete" properly removes the key and thus affects the amount of entries in the object, making our length === 0 check effective. Part-of: --- js/misc/objectManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/misc/objectManager.js b/js/misc/objectManager.js index c40975988..a1dcde3a7 100644 --- a/js/misc/objectManager.js +++ b/js/misc/objectManager.js @@ -130,7 +130,7 @@ var ObjectManager = class extends Signals.EventEmitter { this.emit('interface-removed', interfaceName, proxy); - this._objects[objectPath][interfaceName] = null; + delete this._objects[objectPath][interfaceName]; if (Object.keys(this._objects[objectPath]).length === 0) { delete this._objects[objectPath];