mirror of
https://github.com/ReMinecraftPE/mcped.git
synced 2025-01-22 12:11:54 -05:00
* Fix a memory leak + some weirdness.
This commit is contained in:
parent
b710486ebb
commit
8047ce7e03
2 changed files with 10 additions and 1 deletions
|
@ -32,6 +32,14 @@ ExternalFileLevelStorage::ExternalFileLevelStorage(const std::string& a, const s
|
|||
readPlayerData(datPlayer, m_pLevelData);
|
||||
}
|
||||
|
||||
ExternalFileLevelStorage::~ExternalFileLevelStorage()
|
||||
{
|
||||
if (m_pRegionFile)
|
||||
delete m_pRegionFile;
|
||||
if (m_pLevelData)
|
||||
delete m_pLevelData;
|
||||
}
|
||||
|
||||
LevelData* ExternalFileLevelStorage::prepareLevel(Level* level)
|
||||
{
|
||||
m_pLevel = level;
|
||||
|
@ -113,7 +121,7 @@ void ExternalFileLevelStorage::tick()
|
|||
|
||||
if (iter == m_unsavedLevelChunks.end())
|
||||
{
|
||||
UnsavedLevelChunk ulc = { index, RakNet::GetTimeMS(), pChunk };
|
||||
UnsavedLevelChunk ulc = { index, int(RakNet::GetTimeMS()), pChunk };
|
||||
m_unsavedLevelChunks.push_back(ulc);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ class ExternalFileLevelStorage : public LevelStorage, ChunkStorage
|
|||
{
|
||||
public:
|
||||
ExternalFileLevelStorage(const std::string& a, const std::string& path);
|
||||
~ExternalFileLevelStorage();
|
||||
|
||||
// LevelStorage
|
||||
LevelData* prepareLevel(Level* level) override;
|
||||
|
|
Loading…
Reference in a new issue