mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
Core/Transports: Fixed accessing deleted instance transports
Thanks @jackpoz for valgrind log and @pete318 for reproduction steps
Closes #15633
(cherry picked from commit 8745e08be0)
This commit is contained in:
@@ -100,7 +100,6 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa
|
||||
|
||||
void Transport::CleanupsBeforeDelete(bool finalCleanup /*= true*/)
|
||||
{
|
||||
HashMapHolder<Transport>::Remove(this);
|
||||
UnloadStaticPassengers();
|
||||
while (!_passengers.empty())
|
||||
{
|
||||
|
||||
@@ -405,6 +405,13 @@ void Map::DeleteFromWorld(Player* player)
|
||||
delete player;
|
||||
}
|
||||
|
||||
template<>
|
||||
void Map::DeleteFromWorld(Transport* transport)
|
||||
{
|
||||
ObjectAccessor::RemoveObject(transport);
|
||||
delete transport;
|
||||
}
|
||||
|
||||
void Map::EnsureGridCreated(const GridCoord &p)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_gridLock);
|
||||
|
||||
Reference in New Issue
Block a user