Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c209525 authored by Jorge Gil's avatar Jorge Gil
Browse files

Ensure MaximizeMenu is released after close animation

Adds a local val to hold on to the MaximizeMenu ViewContainer reference
during the close animation, so that when the animation ends, the view
container can be released.
Prior to this change, the view container reference was set to null while
the animation ran, which meant that when it finished the attempt to call
release() silently failed because it was now null.

Bug: 362282037
Fix: 361843466
Flag: EXEMPT refactor
Test: open/close maximize menu multiple times, "dumpsys SurfaceFlinger"
doesn't show any Maximize Menu layer

Change-Id: I2947c58666bfb7e70e27f0df7c7247646ae70e4a
parent ec252cbd
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -121,8 +121,14 @@ class MaximizeMenu(

    /** Closes the maximize window and releases its view. */
    fun close() {
        maximizeMenuView?.animateCloseMenu {
            maximizeMenu?.releaseView()
        val view = maximizeMenuView
        val menu = maximizeMenu
        if (view == null) {
            menu?.releaseView()
        } else {
            view.animateCloseMenu {
                menu?.releaseView()
            }
        }
        maximizeMenu = null
        maximizeMenuView = null