forked from rosebudai/OpenRCT2-Web
ensure _objectRepository and _objectManager are freed
This commit is contained in:
1 parent
3f19becc2b
commit
8b03b996c0
2 files changed
+8
-6
No files matched your search
@@ -15,6 +15,7 @@
|
||||
#pragma endregion
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
@@ -578,15 +579,15 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
static ObjectRepository * _objectRepository = nullptr;
|
||||
static std::unique_ptr<ObjectRepository> _objectRepository;
|
||||
|
||||
IObjectRepository * GetObjectRepository()
|
||||
{
|
||||
if (_objectRepository == nullptr)
|
||||
{
|
||||
_objectRepository = new ObjectRepository();
|
||||
_objectRepository = std::unique_ptr<ObjectRepository>(new ObjectRepository());
|
||||
}
|
||||
return _objectRepository;
|
||||
return _objectRepository.get();
|
||||
}
|
||||
|
||||
static int GetObjectEntryIndex(uint8 objectType, uint8 entryIndex)
|
||||
|
||||
Reference in new issue
Block a user