summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/resourcemanager.cpp14
-rw-r--r--src/resources/resourcemanager.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index f398c4b45..9c9bb3b32 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -67,7 +67,7 @@ ResourceManager::~ResourceManager()
{
mDestruction = true;
mResources.insert(mOrphanedResources.begin(), mOrphanedResources.end());
- mResources.insert(mDeletedResources.begin(), mDeletedResources.end());
+// mResources.insert(mDeletedResources.begin(), mDeletedResources.end());
// Release any remaining spritedefs first because they depend on image sets
ResourceIterator iter = mResources.begin();
@@ -673,16 +673,16 @@ void ResourceManager::release(Resource *const res)
if (!res || mDestruction)
return;
- ResourceIterator resIter = mDeletedResources.find(res->mIdPath);
- if (resIter != mDeletedResources.end() && resIter->second == res)
+ std::set<Resource*>::iterator resDelIter = mDeletedResources.find(res);
+ if (resDelIter != mDeletedResources.end())
{
// we found zero counted image in deleted list. deleting it and exit.
- mDeletedResources.erase(resIter);
+ mDeletedResources.erase(resDelIter);
delete res;
return;
}
- resIter = mResources.find(res->mIdPath);
+ ResourceIterator resIter = mResources.find(res->mIdPath);
// The resource has to exist
assert(resIter != mResources.end() && resIter->second == res);
@@ -707,13 +707,13 @@ void ResourceManager::moveToDeleted(Resource *const res)
ResourceIterator resIter = mResources.find(res->mIdPath);
if (resIter != mResources.end() && resIter->second == res)
{
- mDeletedResources.insert(*resIter);
+ mDeletedResources.insert(res);
mResources.erase(resIter);
}
resIter = mOrphanedResources.find(res->mIdPath);
if (resIter != mOrphanedResources.end() && resIter->second == res)
{
- mDeletedResources.insert(*resIter);
+ mDeletedResources.insert(res);
mOrphanedResources.erase(resIter);
}
}
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index 2c9fbe3eb..e20e4b3ac 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -312,7 +312,7 @@ class ResourceManager final
std::set<SDL_Surface*> deletedSurfaces;
Resources mResources;
Resources mOrphanedResources;
- Resources mDeletedResources;
+ std::set<Resource*> mDeletedResources;
time_t mOldestOrphan;
std::string mSelectedSkin;
std::string mSkinName;