diff --git a/changelog.d/6808.misc b/changelog.d/6808.misc new file mode 100644 index 0000000000..06eeff862b --- /dev/null +++ b/changelog.d/6808.misc @@ -0,0 +1 @@ +[Call] Memory leak after a call diff --git a/vector/src/main/java/im/vector/app/features/call/VectorCallActivity.kt b/vector/src/main/java/im/vector/app/features/call/VectorCallActivity.kt index f8a4c5eeca..aa46feeea6 100644 --- a/vector/src/main/java/im/vector/app/features/call/VectorCallActivity.kt +++ b/vector/src/main/java/im/vector/app/features/call/VectorCallActivity.kt @@ -241,6 +241,7 @@ class VectorCallActivity : detachRenderersIfNeeded() turnScreenOffAndKeyguardOn() removeOnPictureInPictureModeChangedListener(pictureInPictureModeChangedInfoConsumer) + screenCaptureServiceConnection.unbind() super.onDestroy() } diff --git a/vector/src/main/java/im/vector/app/features/call/webrtc/ScreenCaptureServiceConnection.kt b/vector/src/main/java/im/vector/app/features/call/webrtc/ScreenCaptureServiceConnection.kt index f55a3559bd..41105ddafb 100644 --- a/vector/src/main/java/im/vector/app/features/call/webrtc/ScreenCaptureServiceConnection.kt +++ b/vector/src/main/java/im/vector/app/features/call/webrtc/ScreenCaptureServiceConnection.kt @@ -47,6 +47,10 @@ class ScreenCaptureServiceConnection @Inject constructor( } } + fun unbind() { + callback = null + } + fun stopScreenCapturing() { screenCaptureAndroidService?.stopService() }