Merge branch 'master' of https://github.com/highfidelity/hifi into metavoxels

This commit is contained in:
Andrzej Kapolka 2014-12-15 17:09:32 -08:00
commit 564bce7c10

View file

@ -28,10 +28,14 @@ ResourceCache::ResourceCache(QObject* parent) :
} }
ResourceCache::~ResourceCache() { ResourceCache::~ResourceCache() {
// make sure our unused resources know we're out of commission // the unused resources may themselves reference resources that will be added to the unused
// list on destruction, so keep clearing until there are no references left
while (!_unusedResources.isEmpty()) {
foreach (const QSharedPointer<Resource>& resource, _unusedResources) { foreach (const QSharedPointer<Resource>& resource, _unusedResources) {
resource->setCache(NULL); resource->setCache(NULL);
} }
_unusedResources.clear();
}
} }
void ResourceCache::refresh(const QUrl& url) { void ResourceCache::refresh(const QUrl& url) {