mirror of https://github.com/OpenRCT2/OpenRCT2.git
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:
parent
463ec2025a
commit
a79e742f39
|
@ -535,7 +535,10 @@ IObjectManager * GetObjectManager()
|
||||||
if (_objectManager == nullptr)
|
if (_objectManager == nullptr)
|
||||||
{
|
{
|
||||||
IObjectRepository * objectRepository = GetObjectRepository();
|
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();
|
return _objectManager.get();
|
||||||
}
|
}
|
||||||
|
@ -580,6 +583,9 @@ extern "C"
|
||||||
void object_manager_unload_all_objects()
|
void object_manager_unload_all_objects()
|
||||||
{
|
{
|
||||||
IObjectManager * objectManager = GetObjectManager();
|
IObjectManager * objectManager = GetObjectManager();
|
||||||
objectManager->UnloadAll();
|
if (objectManager != nullptr)
|
||||||
|
{
|
||||||
|
objectManager->UnloadAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue