mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Fixing activity leak on config change
If attachTo happens before the view is attached to window, ViewOnDrawExecutor hooks to the tree observer twice (second time from onViewAttachedToWindow). It only unhooks once. Since tree observer is global, this leads to leaking the activity, and besides, all old activities getting the events from the tree observer. Bug: 139137636 Change-Id: Ie2641b8f3614545052fe34ad6588b070c3b82a33
This commit is contained in:
@@ -55,7 +55,9 @@ public class ViewOnDrawExecutor implements Executor, OnDrawListener, Runnable,
|
||||
mLoadAnimationCompleted = true;
|
||||
}
|
||||
|
||||
attachObserver();
|
||||
if (mAttachedView.isAttachedToWindow()) {
|
||||
attachObserver();
|
||||
}
|
||||
}
|
||||
|
||||
private void attachObserver() {
|
||||
|
||||
Reference in New Issue
Block a user