Skip to content

Commit

Permalink
Delay deletion Eluna state for maps (#6)
Browse files Browse the repository at this point in the history
This ensures all objects on the map has been unloaded properly and their event processor has been deleted.

Fixes #5
  • Loading branch information
Foereaper authored and Niam5 committed Nov 23, 2024
1 parent 7806260 commit b1c6f94
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/game/Maps/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ Map::~Map()
if (Eluna* e = GetEluna())
if (Instanceable())
e->FreeInstanceId(GetInstanceId());

delete eluna;
eluna = nullptr;
#endif
UnloadAll(true);

Expand All @@ -90,6 +87,11 @@ Map::~Map()

for (auto m_Transport : m_transports)
delete m_Transport;

#ifdef BUILD_ELUNA
delete eluna;
eluna = nullptr;
#endif
}

uint32 Map::GetCurrentMSTime() const
Expand Down

0 comments on commit b1c6f94

Please sign in to comment.