libhwui: AnimatedImageThread fix 'UAF' nits

nits from UAF CL:
- we don't need to be careful about destroying this thread
- overly verbose return

Bug: 186468053
Test: N/A
Change-Id: I96b3c5b038529341381865cbd5784ac54ba2fc9e
This commit is contained in:
Steven Moreland
2021-04-27 18:26:11 +00:00
parent cda49ca089
commit 16d2ddd830

View File

@@ -22,12 +22,12 @@ namespace android {
namespace uirenderer {
AnimatedImageThread& AnimatedImageThread::getInstance() {
[[clang::no_destroy]] static sp<AnimatedImageThread> sInstance = []() {
static sp<AnimatedImageThread> sInstance = []() {
sp<AnimatedImageThread> thread = sp<AnimatedImageThread>::make();
thread->start("AnimatedImageThread");
return thread;
}();
return *sInstance.get();
return *sInstance;
}
AnimatedImageThread::AnimatedImageThread() {