summaryrefslogtreecommitdiff
path: root/src/resources/resourcemanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-27 19:43:36 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-27 19:43:36 +0300
commit5b72d1606316a05fb0121b4244583b3435ea0db8 (patch)
tree14ccdadbd5319d27335657fae7ca348ab1ad268f /src/resources/resourcemanager.cpp
parent5c0b932b4c3dcd339d0ef123c24fb7de427162d5 (diff)
downloadmanaplus-5b72d1606316a05fb0121b4244583b3435ea0db8.tar.gz
manaplus-5b72d1606316a05fb0121b4244583b3435ea0db8.tar.bz2
manaplus-5b72d1606316a05fb0121b4244583b3435ea0db8.tar.xz
manaplus-5b72d1606316a05fb0121b4244583b3435ea0db8.zip
Call cleanOrphans after disconnecting from server.
Diffstat (limited to 'src/resources/resourcemanager.cpp')
-rw-r--r--src/resources/resourcemanager.cpp4
1 files changed, 2 insertions, 2 deletions
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();