From 4ed8573f74479fe0da71c18676417cc1266f0e83 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Thu, 14 Apr 2016 17:28:24 -0700 Subject: [PATCH] CR --- interface/src/scripting/GlobalServicesScriptingInterface.cpp | 2 +- interface/src/ui/Stats.cpp | 2 +- libraries/networking/src/ResourceCache.cpp | 2 +- libraries/networking/src/ResourceCache.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/interface/src/scripting/GlobalServicesScriptingInterface.cpp b/interface/src/scripting/GlobalServicesScriptingInterface.cpp index e6d87a0260..e8d63a6d99 100644 --- a/interface/src/scripting/GlobalServicesScriptingInterface.cpp +++ b/interface/src/scripting/GlobalServicesScriptingInterface.cpp @@ -122,7 +122,7 @@ void DownloadInfoResultFromScriptValue(const QScriptValue& object, DownloadInfoR DownloadInfoResult GlobalServicesScriptingInterface::getDownloadInfo() { DownloadInfoResult result; - foreach(auto resource, ResourceCache::getLoadingRequests()) { + foreach(const auto& resource, ResourceCache::getLoadingRequests()) { result.downloading.append(resource->getProgress() * 100.0f); } result.pending = ResourceCache::getPendingRequestCount(); diff --git a/interface/src/ui/Stats.cpp b/interface/src/ui/Stats.cpp index d1cb4cf3c2..ec4b2280b6 100644 --- a/interface/src/ui/Stats.cpp +++ b/interface/src/ui/Stats.cpp @@ -214,7 +214,7 @@ void Stats::updateStats(bool force) { // If the urls have changed, update the list if (shouldUpdateUrls) { _downloadUrls.clear(); - foreach (auto resource, loadingRequests) { + foreach (const auto& resource, loadingRequests) { _downloadUrls << resource->getURL().toString(); } emit downloadUrlsChanged(); diff --git a/libraries/networking/src/ResourceCache.cpp b/libraries/networking/src/ResourceCache.cpp index 5f7cf7926a..aa8022e89b 100644 --- a/libraries/networking/src/ResourceCache.cpp +++ b/libraries/networking/src/ResourceCache.cpp @@ -295,7 +295,7 @@ bool ResourceCache::attemptRequest(QSharedPointer resource) { return true; } -void ResourceCache::requestCompleted(QSharedPointer resource) { +void ResourceCache::requestCompleted(QWeakPointer resource) { auto sharedItems = DependencyManager::get(); sharedItems->removeRequest(resource); --_requestsActive; diff --git a/libraries/networking/src/ResourceCache.h b/libraries/networking/src/ResourceCache.h index 94fcafee9e..ad9ba10a7c 100644 --- a/libraries/networking/src/ResourceCache.h +++ b/libraries/networking/src/ResourceCache.h @@ -141,7 +141,7 @@ protected: /// Attempt to load a resource if requests are below the limit, otherwise queue the resource for loading /// \return true if the resource began loading, otherwise false if the resource is in the pending queue static bool attemptRequest(QSharedPointer resource); - static void requestCompleted(QSharedPointer resource); + static void requestCompleted(QWeakPointer resource); static bool attemptHighestPriorityRequest(); private: