destroyRTCEngine static method

Future destroyRTCEngine()

@detail api @author wangzhanqiang @brief Destroy the engine instance created by createRTCEngine{@link #RTCEngine#createRTCEngine}, and release all related resources. @note - Call this API after all business scenarios related to the engine instance are destroyed. - When the API is called, RTC SDK destroys all memory associated with the engine instance and stops any interaction with the media server. - Calling this API will start the SDK exit logic. The engine thread is held until the exit logic is complete. The engine thread is retained until the exit logic is complete. Therefore, do not call this API directly in the callback thread, or it will cause a deadlock. This function takes a long time to execute, so it's not recommended to call this API in the main thread, or the main thread may be blocked.

Implementation

static Future destroyRTCEngine() async {
  $a() => $p_a.RTCEngine.destroyRTCEngine();
  $i() => $p_i.ByteRTCEngine.destroyRTCEngine();

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}