From 2995b2271a031aad5197efdc0aba8f96600db7eb Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Mon, 14 Oct 2024 17:55:53 +0200 Subject: [PATCH] Fixing mind-bogingingly strange issue causing Qt crash when attempting to set WeakSet during mouse move events. --- common/src/events.mjs | 6 +++--- common/src/module/settings.mjs | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/src/events.mjs b/common/src/events.mjs index 25f5bf3..75a7a52 100644 --- a/common/src/events.mjs +++ b/common/src/events.mjs @@ -23,17 +23,17 @@ export class BaseEvent { - #name + ___name = "" /** * @property {string} name - Name of the event. */ constructor(name) { - this.#name = name + this.___name = name } get name() { - return this.#name + return this.___name } } diff --git a/common/src/module/settings.mjs b/common/src/module/settings.mjs index 64c39c2..8ea152d 100644 --- a/common/src/module/settings.mjs +++ b/common/src/module/settings.mjs @@ -115,7 +115,8 @@ class SettingsAPI extends Module { if(propType !== typeof value) throw new Error(`Value of ${property} must be a ${propType} (${typeof value} provided).`) this.#properties.set(property, value) - this.emit(new ChangedEvent(property, oldValue, value, byUser === true)) + const evt = new ChangedEvent(property, oldValue, value, byUser === true) + this.emit(evt) } /**