1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-18 13:48:58 +02:00

fix: tear down also event handlers in addon service

This commit is contained in:
sjaanus 2025-07-03 11:23:08 +03:00
parent bfbdc1f65a
commit 311b8e09d0
No known key found for this signature in database
GPG Key ID: 20E007C0248BA7FF

View File

@ -367,7 +367,6 @@ export default class AddonService {
}
destroy(): void {
// Clean up event handlers first to prevent race conditions during teardown
this.eventHandlers.forEach((handler, eventName) => {
try {
this.eventService.off(eventName, handler);
@ -380,7 +379,6 @@ export default class AddonService {
});
this.eventHandlers.clear();
// Then destroy addon providers
Object.values(this.addonProviders).forEach((addon) =>
addon.destroy?.(),
);