From 16e38bf5a26bd609ff21c0edb494a96a8566cb76 Mon Sep 17 00:00:00 2001 From: gxz Date: Tue, 12 Mar 2024 16:33:54 +0800 Subject: [PATCH] chore: optimize --- src/internal/RtcEngineExInternal.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/internal/RtcEngineExInternal.ts b/src/internal/RtcEngineExInternal.ts index c571eae3..568227e0 100644 --- a/src/internal/RtcEngineExInternal.ts +++ b/src/internal/RtcEngineExInternal.ts @@ -79,6 +79,9 @@ export class RtcEngineExInternal extends IRtcEngineExImpl { override release(sync: boolean = false) { this._media_engine.release(); this._local_spatial_audio_engine.release(); + RtcEngineExInternal._event_handlers.map((it) => { + super.unregisterEventHandler(it); + }); RtcEngineExInternal._event_handlers = []; RtcEngineExInternal._direct_cdn_streaming_event_handler = []; RtcEngineExInternal._metadata_observer = []; @@ -91,7 +94,6 @@ export class RtcEngineExInternal extends IRtcEngineExImpl { MediaRecorderInternal._observers.clear(); this._h265_transcoder.release(); this.removeAllListeners(); - this.unregisterEventHandler(this as IRtcEngineEventHandler); super.release(sync); }