Index: src/utils/SkTaskGroup.cpp |
diff --git a/src/utils/SkTaskGroup.cpp b/src/utils/SkTaskGroup.cpp |
index 7449eb65655c4231863c323318717a8af28b388c..a93b34fd1636512913f31a7dc8c81eaa1723c73c 100644 |
--- a/src/utils/SkTaskGroup.cpp |
+++ b/src/utils/SkTaskGroup.cpp |
@@ -67,7 +67,7 @@ private: |
}; |
explicit ThreadPool(int threads) : fDraining(false) { |
- if (threads == 0) { |
+ if (threads == -1) { |
threads = num_cores(); |
} |
for (int i = 0; i < threads; i++) { |
@@ -133,11 +133,12 @@ ThreadPool* ThreadPool::gGlobal = NULL; |
SkTaskGroup::Enabler::Enabler(int threads) { |
SkASSERT(ThreadPool::gGlobal == NULL); |
- ThreadPool::gGlobal = SkNEW_ARGS(ThreadPool, (threads)); |
+ if (threads != 0) { |
+ ThreadPool::gGlobal = SkNEW_ARGS(ThreadPool, (threads)); |
+ } |
} |
SkTaskGroup::Enabler::~Enabler() { |
- SkASSERT(ThreadPool::gGlobal != NULL); |
SkDELETE(ThreadPool::gGlobal); |
} |