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

Commit 98db1264 authored by Doris Liu's avatar Doris Liu Committed by Android (Google) Code Review
Browse files

Merge "Fix AVD memory leak" into oc-dev

parents 6890dc95 0bfce2cc
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -208,8 +208,15 @@ public:

    void detachAnimators() {
        // Remove animators from the list and post a delayed message in future to end the animator
        // For infinite animators, remove the listener so we no longer hold a global ref to the AVD
        // java object, and therefore the AVD objects in both native and Java can be properly
        // released.
        for (auto& anim : mRunningVDAnimators) {
            detachVectorDrawableAnimator(anim.get());
            anim->clearOneShotListener();
        }
        for (auto& anim : mPausedVDAnimators) {
            anim->clearOneShotListener();
        }
        mRunningVDAnimators.clear();
        mPausedVDAnimators.clear();