Core: Fix a possible crash in WorldSession::ProcessQueryCallbacks

Author: Cyberbrest
Closes issue #5262

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-12-24 19:46:11 +01:00
parent 1e736fb32a
commit 398d71285d
3 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -867,7 +867,7 @@ class ObjectMgr
void LoadCreatures(); void LoadCreatures();
void LoadLinkedRespawn(); void LoadLinkedRespawn();
bool SetCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid); bool SetCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid);
void LoadCreatureRespawnTimes(); void LoadLinkedRespawnTimes();
void LoadCreatureAddons(); void LoadCreatureAddons();
void LoadCreatureModelInfo(); void LoadCreatureModelInfo();
void LoadEquipmentTemplates(); void LoadEquipmentTemplates();
@@ -58,7 +58,7 @@ void WorldSession::SendNameQueryOpcode(Player *p)
void WorldSession::SendNameQueryOpcodeFromDB(uint64 guid) void WorldSession::SendNameQueryOpcodeFromDB(uint64 guid)
{ {
ACE_Future<QueryResult> lFutureResult = QueryResultFuture lFutureResult =
CharacterDatabase.AsyncPQuery( CharacterDatabase.AsyncPQuery(
!sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED) ? !sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED) ?
// ------- Query Without Declined Names -------- // ------- Query Without Declined Names --------
+4
View File
@@ -1003,8 +1003,12 @@ void WorldSession::ProcessQueryCallbacks()
if (m_nameQueryCallbacks.next_readable(lResult, &timeout) != 1) if (m_nameQueryCallbacks.next_readable(lResult, &timeout) != 1)
break; break;
if (lResult.ready())
{
lResult.get(result); lResult.get(result);
SendNameQueryOpcodeFromDBCallBack(result); SendNameQueryOpcodeFromDBCallBack(result);
lResult.cancel();
}
} }
//! HandleCharEnumOpcode //! HandleCharEnumOpcode