mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
Fix #4893: Assertion failed if no RCT2 directory selected on startup
Bit of a hack, temporary until ObjectManager gets same initialisation treatment as ObjectRepository.
This commit is contained in:
@@ -535,7 +535,10 @@ IObjectManager * GetObjectManager()
|
||||
if (_objectManager == nullptr)
|
||||
{
|
||||
IObjectRepository * objectRepository = GetObjectRepository();
|
||||
_objectManager = std::unique_ptr<ObjectManager>(new ObjectManager(objectRepository));
|
||||
if (objectRepository != nullptr)
|
||||
{
|
||||
_objectManager = std::unique_ptr<ObjectManager>(new ObjectManager(objectRepository));
|
||||
}
|
||||
}
|
||||
return _objectManager.get();
|
||||
}
|
||||
@@ -580,6 +583,9 @@ extern "C"
|
||||
void object_manager_unload_all_objects()
|
||||
{
|
||||
IObjectManager * objectManager = GetObjectManager();
|
||||
objectManager->UnloadAll();
|
||||
if (objectManager != nullptr)
|
||||
{
|
||||
objectManager->UnloadAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user