Instance Method
destroy(_:)
銷毀 SDK(離開房間 + 清除 delegates + 停止 core loop + 銷毀 C 實例), 再依 options 刪除 SDK 寫到硬碟的資料
@MainActor func destroy(_ options: DestroyOptions = .default) asyncDiscussion
有執行中的 instance:走完整銷毀流程,C 層銷毀之後才刪除(C 層存活時會自動存檔寫回)
沒有 instance(例如存檔損壞、授權過期導致 initialize 失敗):跳過整段銷毀流程, 只做
options指定的刪除 —— 銷毀流程會碰已失效的 C handle,沒有 instance 時執行有閃退風險
刪除失敗只寫 log、不丟錯。預設 .default 什麼都不刪。
Frame crypto is removed automatically, so there is no need to call clearFrameCryptor() first. Install it again after the next initialize. Every FrameCryptor the SDK holds, including the ones replaced or removed earlier, is released once the media threads have stopped. A userData passed to setFrameCrypto(encrypt:decrypt:getMaxSize:userData:) is owned by the App: release it, and any replaced one, only after this method returns.