address code review comments

This commit is contained in:
Stephen Birarda 2017-09-19 13:56:42 -07:00
parent e1d79ee8f4
commit a8ac015bc4
2 changed files with 4 additions and 2 deletions

View file

@ -280,10 +280,10 @@ void AssetServer::aboutToFinish() {
// abort each of our still running bake tasks, remove pending bakes that were never put on the thread pool // abort each of our still running bake tasks, remove pending bakes that were never put on the thread pool
auto it = _pendingBakes.begin(); auto it = _pendingBakes.begin();
while (it != _pendingBakes.end()) { while (it != _pendingBakes.end()) {
auto pendingRunnable = _bakingTaskPool.tryTake(it.value().get()); auto pendingRunnable = _bakingTaskPool.tryTake(it->get());
if (pendingRunnable) { if (pendingRunnable) {
_pendingBakes.erase(it); it = _pendingBakes.erase(it);
} else { } else {
it.value()->abort(); it.value()->abort();
++it; ++it;

View file

@ -460,6 +460,8 @@ void generateMips(gpu::Texture* texture, QImage& image, const std::atomic<bool>&
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
if (!_abortProcessing.load()) { if (!_abortProcessing.load()) {
task(context, i); task(context, i);
} else {
break;
} }
} }
} }