summaryrefslogtreecommitdiff
path: root/core/java/android/view/SurfaceControlViewHost.java
diff options
context:
space:
mode:
authorRobert Carr <racarr@google.com>2020-05-04 11:23:29 -0700
committerRobert Carr <racarr@google.com>2020-05-04 11:23:29 -0700
commit8644050a99cacd62362a9fe490161c7484cc2caa (patch)
treede99f4efc6d60d8bb5c92df26950192ac63f38fb /core/java/android/view/SurfaceControlViewHost.java
parentfccec793d381e3983531654d990205cc4387e4f3 (diff)
SurfaceControlViewHost: Let ViewRoot release control.
In SurfaceControlViewHost#release we currently immediately release mSurfaceControl and then call ViewRootImpl#doDie. However doDie executes on a handler so the ViewRootImpl may try and use the SurfaceControl between posting and executing the message. Actually this release is totally erroneous, mSurfaceControl is the same object used by the ViewRootImpl and the ViewRootImpl will release it when processing doDie(). Bug: 155575445 Test: Existing tests pass Change-Id: I6a4bf41ba38636ff884aa73d2653b1bab6958b00
Diffstat (limited to 'core/java/android/view/SurfaceControlViewHost.java')
-rw-r--r--core/java/android/view/SurfaceControlViewHost.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/view/SurfaceControlViewHost.java b/core/java/android/view/SurfaceControlViewHost.java
index 3d6da6f71b3f..dcc320dff4c7 100644
--- a/core/java/android/view/SurfaceControlViewHost.java
+++ b/core/java/android/view/SurfaceControlViewHost.java
@@ -264,8 +264,8 @@ public class SurfaceControlViewHost {
* and render the object unusable.
*/
public void release() {
+ // ViewRoot will release mSurfaceControl for us.
mViewRoot.die(false /* immediate */);
- mSurfaceControl.release();
}
/**