diff options
author | Huihong Luo <huisinro@google.com> | 2021-05-14 03:33:53 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-05-14 03:33:53 +0000 |
commit | f410f8134f6143598251b1ba1fd1f9b92ccbcb09 (patch) | |
tree | 8adae29d7d050c6e6ebde5629ca0bbe3945381e7 /libs/hwui/renderthread/CanvasContext.cpp | |
parent | 23f813e89b0dd4d635391ed4905078aac3445003 (diff) | |
parent | e76f1813721c1087ac53bd5cbe854d412e21789e (diff) |
Merge "Fix leakage of ASurfaceTransactionCallback" into sc-dev
Diffstat (limited to 'libs/hwui/renderthread/CanvasContext.cpp')
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index bae1ab5bab44..891a99489fcf 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -195,6 +195,10 @@ void CanvasContext::setSurfaceControl(ASurfaceControl* surfaceControl) { auto funcs = mRenderThread.getASurfaceControlFunctions(); + if (surfaceControl == nullptr) { + setASurfaceTransactionCallback(nullptr); + } + if (mSurfaceControl != nullptr) { funcs.unregisterListenerFunc(this, &onSurfaceStatsAvailable); funcs.releaseFunc(mSurfaceControl); |