1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-10 09:22:25 +03:00

Destroy playback instance on unmount

This commit is contained in:
Jaiwanth
2021-05-26 12:57:39 +05:30
parent a22141616e
commit a4907f8061

View File

@@ -75,6 +75,12 @@ export default class MVoiceMessageBody extends React.PureComponent<IProps, IStat
// Note: the RecordingPlayback component will handle preparing the Playback class for us.
}
public componentWillUnmount() {
if (this.state.playback) {
this.state.playback.destroy();
}
}
public render() {
if (this.state.error) {
// TODO: @@TR: Verify error state