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

Commit edbca128 authored by Romain Guy's avatar Romain Guy
Browse files

Make sure we clean up after ourselves

Because of the mAdded=false statement a few lines above, a large section
of doDie() was not executed. Things would eventually get cleaned up
but it seems better to do it at the right time.

Change-Id: I1a2f3a8e05057dd7cd7205b6d3f9c145d6c0241d
parent 25eba5c5
Loading
Loading
Loading
Loading
+18 −15
Original line number Diff line number Diff line
@@ -2130,7 +2130,7 @@ public final class ViewRootImpl implements ViewParent,
    }

    /**
     * @return true if drawing was succesful, false if an error occured
     * @return true if drawing was succesfull, false if an error occurred
     */
    private boolean drawSoftware(Surface surface, AttachInfo attachInfo, int yoff,
            boolean scalingRequired, Rect dirty) {
@@ -3843,13 +3843,13 @@ public final class ViewRootImpl implements ViewParent,
        if (LOCAL_LOGV) Log.v(TAG, "DIE in " + this + " of " + mSurface);
        synchronized (this) {
            if (mAdded) {
                mAdded = false;
                dispatchDetachedFromWindow();
            }

            if (mAdded && !mFirst) {
                destroyHardwareRenderer();

                if (mView != null) {
                    int viewVisibility = mView.getVisibility();
                    boolean viewVisibilityChanged = mViewVisibility != viewVisibility;
                    if (mWindowAttributesChanged || viewVisibilityChanged) {
@@ -3868,6 +3868,9 @@ public final class ViewRootImpl implements ViewParent,
                    mSurface.release();
                }
            }

            mAdded = false;
        }
    }

    public void requestUpdateConfiguration(Configuration config) {