1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 19:43:06 +01:00

ensure _objectRepository and _objectManager are freed

This commit is contained in:
Ted John
2016-07-07 23:05:55 +01:00
parent 3f19becc2b
commit 8b03b996c0
2 changed files with 8 additions and 6 deletions

View File

@@ -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)