Core/Combat: some more detailed assertions to possibly shed light on #21187.

(cherry picked from commit 5a9fddaa5a)
This commit is contained in:
Treeston
2018-01-06 00:49:04 +01:00
committed by Shauren
parent b00d3812ab
commit 2a7bb9b404
2 changed files with 4 additions and 4 deletions

View File

@@ -307,13 +307,13 @@ void CombatManager::PutReference(ObjectGuid const& guid, CombatReference* ref)
if (ref->_isPvP)
{
auto& inMap = _pvpRefs[guid];
ASSERT(!inMap && "Duplicate combat state detected - memory leak!");
ASSERT(!inMap, "Duplicate combat state at %p being inserted for %s vs %s - memory leak!", ref, _owner->GetGUID().ToString().c_str(), guid.ToString().c_str());
inMap = static_cast<PvPCombatReference*>(ref);
}
else
{
auto& inMap = _pveRefs[guid];
ASSERT(!inMap && "Duplicate combat state detected - memory leak!");
ASSERT(!inMap, "Duplicate combat state at %p being inserted for %s vs %s - memory leak!", ref, _owner->GetGUID().ToString().c_str(), guid.ToString().c_str());
inMap = ref;
}
}

View File

@@ -691,7 +691,7 @@ void ThreatManager::SendNewVictimToClients(ThreatReference const* victimRef) con
void ThreatManager::PutThreatListRef(ObjectGuid const& guid, ThreatReference* ref)
{
auto& inMap = _myThreatListEntries[guid];
ASSERT(!inMap && "Duplicate threat list entry being inserted - memory leak!");
ASSERT(!inMap, "Duplicate threat reference at %p being inserted on %s for %s - memory leak!", ref, _owner->GetGUID().ToString().c_str(), guid.ToString().c_str());
inMap = ref;
ref->_handle = _sortedThreatList.push(ref);
}
@@ -715,7 +715,7 @@ void ThreatManager::PurgeThreatListRef(ObjectGuid const& guid, bool sendRemove)
void ThreatManager::PutThreatenedByMeRef(ObjectGuid const& guid, ThreatReference* ref)
{
auto& inMap = _threatenedByMe[guid];
ASSERT(!inMap && "Duplicate entry being inserted into threatened by me list - potential memory leak!");
ASSERT(!inMap, "Duplicate threatened-by-me reference at %p being inserted on %s for %s - memory leak!", ref, _owner->GetGUID().ToString().c_str(), guid.ToString().c_str());
inMap = ref;
}