mirror of
https://github.com/rosebudai/OpenRCT2-Web.git
synced 2026-12-05 20:55:14 +01:00
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:
1 parent
260f342d73
commit
2eb9657781
5 files changed
+29
-16
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user