mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Fix crash when adding a NULL object to the cache
This commit is contained in:
parent
4c174ecd12
commit
50d7eb8e54
3 changed files with 12 additions and 4 deletions
|
@ -51,6 +51,11 @@ namespace Resource
|
|||
|
||||
void MultiObjectCache::addEntryToObjectCache(const std::string &filename, osg::Object *object)
|
||||
{
|
||||
if (!object)
|
||||
{
|
||||
OSG_ALWAYS << " trying to add NULL object to cache for " << filename << std::endl;
|
||||
return;
|
||||
}
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_objectCacheMutex);
|
||||
_objectCache.insert(std::make_pair(filename, object));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue