From 5b72d1606316a05fb0121b4244583b3435ea0db8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 27 May 2011 19:43:36 +0300 Subject: Call cleanOrphans after disconnecting from server. --- src/resources/resourcemanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/resources/resourcemanager.cpp') diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index c0fe01ca8..a86edbb6f 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -171,14 +171,14 @@ void ResourceManager::cleanUp(Resource *res) delete res; } -void ResourceManager::cleanOrphans() +void ResourceManager::cleanOrphans(bool always) { timeval tv; gettimeofday(&tv, NULL); // Delete orphaned resources after 30 seconds. time_t oldest = tv.tv_sec, threshold = oldest - 30; - if (mOrphanedResources.empty() || mOldestOrphan >= threshold) + if (mOrphanedResources.empty() || (!always && mOldestOrphan >= threshold)) return; ResourceIterator iter = mOrphanedResources.begin(); -- cgit v1.2.3-70-g09d2