MVVM - Introduce the concept of disposables to track event listeners, sub vms and so on (#30475)
* Introduce disposables to track sub vms and event listeners * Remove old code * Use disposable in BaseViewModel * Update vm so that the listener is tracked through disposable * No-op on dispose call instead of throwing error * Throw error in trackListener as well * Fix audio player vm * Expose isDisposed through base vm * Dispose AudioPlayerViewModel
This commit is contained in:
@@ -74,6 +74,7 @@ export default class MAudioBody extends React.PureComponent<IBodyProps, IState>
|
||||
|
||||
public componentWillUnmount(): void {
|
||||
this.state.playback?.destroy();
|
||||
this.state.audioPlayerVm?.dispose();
|
||||
}
|
||||
|
||||
protected get showFileBody(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user