diff options
author | Romain Guy <romainguy@google.com> | 2013-03-20 19:15:02 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2013-03-20 19:16:53 -0700 |
commit | c5cbee7d78513527e89450e6369a30a04b2d5e7a (patch) | |
tree | a3709dd93124509c4490b889622b277d11fbef30 /libs/hwui/thread/TaskManager.cpp | |
parent | 9eac52698b18d089e73c7ec2bf73a64a39504733 (diff) |
Stop worker threads on memory trim & fix bad pointer access
Change-Id: I6fe7e31aeb6dd41fa65ab952caed97bc2da510d7
Diffstat (limited to 'libs/hwui/thread/TaskManager.cpp')
-rw-r--r-- | libs/hwui/thread/TaskManager.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/hwui/thread/TaskManager.cpp b/libs/hwui/thread/TaskManager.cpp index ce6c8c04483d..c8bfd9c88165 100644 --- a/libs/hwui/thread/TaskManager.cpp +++ b/libs/hwui/thread/TaskManager.cpp @@ -48,6 +48,12 @@ bool TaskManager::canRunTasks() const { return mThreads.size() > 0; } +void TaskManager::stop() { + for (size_t i = 0; i < mThreads.size(); i++) { + mThreads[i]->exit(); + } +} + bool TaskManager::addTaskBase(const sp<TaskBase>& task, const sp<TaskProcessorBase>& processor) { if (mThreads.size() > 0) { TaskWrapper wrapper(task, processor); |