diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-16 14:28:45 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-16 14:28:45 +0200 |
commit | 59dc0bffc0f754de8daed29bce3a48e90ea6b4fb (patch) | |
tree | 7cd423679a60e25b29318d7a87f367729f8d5fdf /src/resources/resourcemanager.cpp | |
parent | fbf665912933d10d9132b17802949149d9094fdd (diff) | |
download | manaplus-59dc0bffc0f754de8daed29bce3a48e90ea6b4fb.tar.gz manaplus-59dc0bffc0f754de8daed29bce3a48e90ea6b4fb.tar.bz2 manaplus-59dc0bffc0f754de8daed29bce3a48e90ea6b4fb.tar.xz manaplus-59dc0bffc0f754de8daed29bce3a48e90ea6b4fb.zip |
Add checks and fix some code style.
Diffstat (limited to 'src/resources/resourcemanager.cpp')
-rw-r--r-- | src/resources/resourcemanager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 312c972f9..3ba99d248 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -372,6 +372,8 @@ struct ResourceLoader ResourceManager::loader fun; static Resource *load(void *v) { + if (!v) + return NULL; ResourceLoader *l = static_cast< ResourceLoader * >(v); int fileSize; if (!l->manager) @@ -527,7 +529,8 @@ void ResourceManager::release(Resource *res) time_t timestamp = tv.tv_sec; res->mTimeStamp = timestamp; - if (mOrphanedResources.empty()) mOldestOrphan = timestamp; + if (mOrphanedResources.empty()) + mOldestOrphan = timestamp; mOrphanedResources.insert(*resIter); mResources.erase(resIter); |