From 8667de423a1fbe9465f210cc62377840a3d369d8 Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Thu, 11 Aug 2022 15:22:20 +0200 Subject: [PATCH 1/2] Unbinding callback from Call screen when view is destroyed --- .../java/im/vector/app/features/call/VectorCallActivity.kt | 1 + .../features/call/webrtc/ScreenCaptureServiceConnection.kt | 4 ++++ 2 files changed, 5 insertions(+) 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() } From 292f6622bd70d0eec00f0bc47fc24c7de634aafc Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Thu, 11 Aug 2022 15:28:18 +0200 Subject: [PATCH 2/2] Adding changelog entry --- changelog.d/6808.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/6808.misc 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