diff --git a/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java b/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java index f32bac9c9..6c6ed9d38 100644 --- a/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +++ b/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java @@ -102,6 +102,9 @@ public WebRTCModule(ReactApplicationContext reactContext) { .setVideoDecoderFactory(decoderFactory) .createPeerConnectionFactory(); + // PeerConnectionFactory now owns the adm native pointer, and we don't need it anymore. + adm.release(); + // Saving the encoder and decoder factories to get codec info later when needed. mVideoEncoderFactory = encoderFactory; mVideoDecoderFactory = decoderFactory; @@ -116,14 +119,6 @@ public String getName() { return "WebRTCModule"; } - @Override - public void onCatalystInstanceDestroy() { - if (mAudioDeviceModule != null) { - mAudioDeviceModule.release(); - } - super.onCatalystInstanceDestroy(); - } - private PeerConnection getPeerConnection(int id) { PeerConnectionObserver pco = mPeerConnectionObservers.get(id); return (pco == null) ? null : pco.getPeerConnection(); diff --git a/examples/GumTestApp/package.json b/examples/GumTestApp/package.json index 7bd8507e5..9dbcaade0 100644 --- a/examples/GumTestApp/package.json +++ b/examples/GumTestApp/package.json @@ -13,7 +13,7 @@ "dependencies": { "react": "18.2.0", "react-native": "0.71.4", - "react-native-webrtc": "*" + "@livekit/react-native-webrtc": "*" }, "devDependencies": { "@babel/core": "^7.20.0",