[Android] Stop the visualizer when it's detached from the window

Nicolas Pomepuy git at videolan.org
Mon May 13 12:24:30 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri May  3 09:14:19 2024 +0200| [04a894d105b6b628159fdcda0f34ef6f24a0ed28] | committer: Duncan McNamara

Stop the visualizer when it's detached from the window

Fixes some mem leaks

> https://code.videolan.org/videolan/vlc-android/commit/04a894d105b6b628159fdcda0f34ef6f24a0ed28
---

 .../vlc-android/src/org/videolan/vlc/gui/view/MiniVisualizer.kt     | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/view/MiniVisualizer.kt b/application/vlc-android/src/org/videolan/vlc/gui/view/MiniVisualizer.kt
index 5b0c19cf76..fbeb54ae0d 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/view/MiniVisualizer.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/view/MiniVisualizer.kt
@@ -118,4 +118,10 @@ class MiniVisualizer : LinearLayout {
             stopSet.start()
         }
     }
+
+    override fun onDetachedFromWindow() {
+        super.onDetachedFromWindow()
+        stop()
+    }
+
 }
\ No newline at end of file



More information about the Android mailing list