summaryrefslogtreecommitdiff
path: root/libs/hwui/thread
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2019-04-04 15:49:40 -0700
committerJohn Reck <jreck@google.com>2019-04-04 16:05:10 -0700
commit5ff61f32a78dca0c722c8ac2685874a26190ceed (patch)
treef795a2a4c2d8c4386a0be6840e0f0f96ad020c25 /libs/hwui/thread
parentdd07ae579c291a2b6ffe09bd576fd908eb9e5ddd (diff)
Fix lifecycle issue in CommonPool
Destroy things more faster Fixes: 129250875 Test: hwui_unit_tests Change-Id: I7e060fcb61f5321dd9e68a3ee4a01868033b3fc3
Diffstat (limited to 'libs/hwui/thread')
-rw-r--r--libs/hwui/thread/CommonPool.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/hwui/thread/CommonPool.h b/libs/hwui/thread/CommonPool.h
index aef2990d6343..51628259d2a8 100644
--- a/libs/hwui/thread/CommonPool.h
+++ b/libs/hwui/thread/CommonPool.h
@@ -57,11 +57,13 @@ public:
mHead = newHead;
}
- constexpr T&& pop() {
+ constexpr T pop() {
LOG_ALWAYS_FATAL_IF(mTail == mHead, "empty");
int index = mTail;
mTail = (mTail + 1) % SIZE;
- return std::move(mBuffer[index]);
+ T ret = std::move(mBuffer[index]);
+ mBuffer[index] = nullptr;
+ return ret;
}
private: