Fix: WidgetMessaging not properly closed causing side effects and bugs (#31598)
* test: Add a failing test reproducing the multi messaging leak bug * fix: Missing widgetApi stop causing leaks
This commit is contained in:
@@ -508,6 +508,8 @@ export class WidgetMessaging extends TypedEventEmitter<WidgetMessagingEvent, Wid
|
||||
}
|
||||
|
||||
this.emit(WidgetMessagingEvent.Stop, this.widgetApi);
|
||||
this.widgetApi?.stop();
|
||||
// XXX is the removeAllListeners necessary here?
|
||||
this.widgetApi?.removeAllListeners(); // Insurance against resource leaks
|
||||
this.widgetApi = null;
|
||||
this.iframe = null;
|
||||
|
||||
Reference in New Issue
Block a user