diff options
Diffstat (limited to 'src/game/MiscHandler.cpp')
-rw-r--r-- | src/game/MiscHandler.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index bb52ac3b52e..e1cf4165005 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -537,7 +537,7 @@ void WorldSession::HandleAddFriendOpcode( WorldPacket & recv_data ) CharacterDatabase.AsyncPQuery(&WorldSession::HandleAddFriendOpcodeCallBack, GetAccountId(), friendNote, "SELECT guid, race, account FROM characters WHERE name = '%s'", friendName.c_str()); } -void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 accountId, std::string friendNote) +void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult_AutoPtr result, uint32 accountId, std::string friendNote) { uint64 friendGuid; uint64 friendAcctid; @@ -558,8 +558,6 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 acc team = Player::TeamForRace((*result)[1].GetUInt8()); friendAcctid = (*result)[2].GetUInt32(); - delete result; - if ( session->GetSecurity() >= SEC_MODERATOR || sWorld.getConfig(CONFIG_ALLOW_GM_FRIEND) || accmgr.GetSecurity(friendAcctid) < SEC_MODERATOR) { if(friendGuid) @@ -627,7 +625,7 @@ void WorldSession::HandleAddIgnoreOpcode( WorldPacket & recv_data ) CharacterDatabase.AsyncPQuery(&WorldSession::HandleAddIgnoreOpcodeCallBack, GetAccountId(), "SELECT guid FROM characters WHERE name = '%s'", IgnoreName.c_str()); } -void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult *result, uint32 accountId) +void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult_AutoPtr result, uint32 accountId) { uint64 IgnoreGuid; FriendsResult ignoreResult; @@ -644,8 +642,6 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult *result, uint32 acc { IgnoreGuid = MAKE_NEW_GUID((*result)[0].GetUInt32(), 0, HIGHGUID_PLAYER); - delete result; - if(IgnoreGuid) { if(IgnoreGuid==session->GetPlayer()->GetGUID()) //not add yourself @@ -1306,7 +1302,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) uint32 accid = plr->GetSession()->GetAccountId(); - QueryResult *result = loginDatabase.PQuery("SELECT username,email,last_ip FROM account WHERE id=%u", accid); + QueryResult_AutoPtr result = loginDatabase.PQuery("SELECT username,email,last_ip FROM account WHERE id=%u", accid); if(!result) { SendNotification(LANG_ACCOUNT_FOR_PLAYER_NOT_FOUND, charname.c_str()); @@ -1330,8 +1326,6 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) data << msg; _player->GetSession()->SendPacket(&data); - delete result; - sLog.outDebug("Received whois command from player %s for character %s", GetPlayer()->GetName(), charname.c_str()); } |