Fix premature deletion of dependencies (#5952)

In particular, the object repository can potentially be deleted before the object manager is deleted. This causes a crash when the object manager is deleted because it requires the object repository within the destructor.
This commit is contained in:
Ted John authored and GitHub committed 2017-07-20 17:44:31 +01:00
1 parent 260f342d73
commit 2eb9657781
5 files changed
+29 -16

No files matched your search

+4 -4
View File
@@ -698,17 +698,17 @@ private:
}
};
static std::unique_ptr<ObjectRepository> _objectRepository;
static ObjectRepository * _objectRepository = nullptr;
IObjectRepository * CreateObjectRepository(IPlatformEnvironment * env)
{
_objectRepository = std::unique_ptr<ObjectRepository>(new ObjectRepository(env));
return _objectRepository.get();
_objectRepository = new ObjectRepository(env);
return _objectRepository;
}
IObjectRepository * GetObjectRepository()
{
return _objectRepository.get();
return _objectRepository;
}
bool IsObjectCustom(const ObjectRepositoryItem * object)