Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Call ASurfaceTransaction_apply() to avoid surface leak
ASurfaceTransaction_setOnComplete and setOnCommit increase reference count of SurfaceControl in following steps in AOSP. 1. SurfaceComposerClient::Transaction::addTransactionCallback 2. TransactionCompletedListener::addCallbackFunction In Step2, reference count of SurfaceControl increase and the count only decrease in TransactionCompletedListener:: onTransactionCompleted(). So if Apply() is not called for the transaction, the reference count never decrease. TranasactionCompletedListener is singleton object, so the reference does not decrease even though the transaction is destroyed. In T OS, ASurfaceTransaction_setBuffer call setOnComplete internally, so SurfaceControl will leak if apply() is not called. This patch make sure to call apply() in ~Transaction() 1. if setBuffer has been called. (T OS bug) 2. if setOnCommit or setOnComplete has been called. Bug: 1395271 Change-Id: Idbd28915c53e760a7514dc30b6d2ad697f41c43b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4074994 Reviewed-by: Sami Kyöstilä <skyostil@chromium.org> Commit-Queue: Sangheon Kim <sangheon77.kim@samsung.com> Reviewed-by: Bo Liu <boliu@chromium.org> Cr-Commit-Position: refs/heads/main@{#1084825}
- Loading branch information
Showing
2 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters