summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderThread.cpp
diff options
context:
space:
mode:
authorScott Lobdell <slobdell@google.com>2021-04-10 00:27:34 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-04-10 00:27:34 +0000
commit01da99e3e562d93c902419316b2f6aa464777e16 (patch)
tree2fe6d242f8218ab669e2a98f757a85005ff88088 /libs/hwui/renderthread/RenderThread.cpp
parent80bf29781b44a4c22692a3a1a1e60a371471c25a (diff)
parent6560a5b465795d6922ccd0c83693fa04be2910a6 (diff)
Merge changes from topic "SP1A.210407.002" into s-keystone-qcom-dev
* changes: Adapt to new ranking logic from upstream. Revert "Initial data pipeline for Smartspace media recommendations data in media carousel." Merge SP1A.210407.002
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.cpp')
-rw-r--r--libs/hwui/renderthread/RenderThread.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index adf4aee8b931..79b938841bc2 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -153,10 +153,11 @@ JVMAttachHook RenderThread::getOnStartHook() {
}
RenderThread& RenderThread::getInstance() {
- // This is a pointer because otherwise __cxa_finalize
- // will try to delete it like a Good Citizen but that causes us to crash
- // because we don't want to delete the RenderThread normally.
- static RenderThread* sInstance = new RenderThread();
+ [[clang::no_destroy]] static sp<RenderThread> sInstance = []() {
+ sp<RenderThread> thread = sp<RenderThread>::make();
+ thread->start("RenderThread");
+ return thread;
+ }();
gHasRenderThreadInstance = true;
return *sInstance;
}
@@ -171,7 +172,6 @@ RenderThread::RenderThread()
, mFunctorManager(WebViewFunctorManager::instance())
, mGlobalProfileData(mJankDataMutex) {
Properties::load();
- start("RenderThread");
}
RenderThread::~RenderThread() {