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

Skip to content
Commit 9e0302fc authored by Jayant Chowdhary's avatar Jayant Chowdhary
Browse files

AImage: don't allow ~AImageReader to run before AImages are deleted.



We can never be sure whether ~AImageReader() has run to completion or
not in AImage::close(). So we move clean up to another AImageReader
method and make sure that's called when in AImageReader_delete. AImage
now contains an sp<> to AImageReader so we can be sure that its members
wouldn't have been destroyed by ~AImageReader and we can check whether
AImageReader_delete has been called on it.

This also prevents us from deadlocking since AImage_delete could also cause
~AImageReader to run with AImageReader::mLock held in AImage::close().

Bug: 137571625
Bug: 137694217

Test: enroll; auth
Test: cts native AImageReader, camera, graphics tests

Change-Id: If5803cb6fcb6f4800032069872daaeac1cd36ed2
Signed-off-by: default avatarJayant Chowdhary <jchowdhary@google.com>
parent 4c6d9952
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment