aboutsummaryrefslogtreecommitdiff
path: root/src/game/WorldSession.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/WorldSession.cpp')
-rw-r--r--src/game/WorldSession.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp
index 7b7dac2c31b..c87421e4d59 100644
--- a/src/game/WorldSession.cpp
+++ b/src/game/WorldSession.cpp
@@ -566,7 +566,7 @@ void WorldSession::LoadGlobalAccountData()
);
}
-void WorldSession::LoadAccountData(QueryResult* result, uint32 mask)
+void WorldSession::LoadAccountData(QueryResult_AutoPtr result, uint32 mask)
{
for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
if (mask & (1 << i))
@@ -598,8 +598,6 @@ void WorldSession::LoadAccountData(QueryResult* result, uint32 mask)
m_accountData[type].Data = fields[2].GetCppString();
} while (result->NextRow());
-
- delete result;
}
void WorldSession::SetAccountData(AccountDataType type, time_t time_, std::string data)
@@ -648,7 +646,7 @@ void WorldSession::LoadTutorialsData()
for (int aX = 0 ; aX < 8 ; ++aX )
m_Tutorials[ aX ] = 0;
- QueryResult *result = CharacterDatabase.PQuery("SELECT tut0,tut1,tut2,tut3,tut4,tut5,tut6,tut7 FROM character_tutorial WHERE account = '%u'", GetAccountId());
+ QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT tut0,tut1,tut2,tut3,tut4,tut5,tut6,tut7 FROM character_tutorial WHERE account = '%u'", GetAccountId());
if(result)
{
@@ -660,10 +658,7 @@ void WorldSession::LoadTutorialsData()
m_Tutorials[iI] = fields[iI].GetUInt32();
}
while( result->NextRow() );
-
- delete result;
}
-
m_TutorialsChanged = false;
}
@@ -682,12 +677,9 @@ void WorldSession::SaveTutorialsData()
uint32 Rows=0;
// it's better than rebuilding indexes multiple times
- QueryResult *result = CharacterDatabase.PQuery("SELECT count(*) AS r FROM character_tutorial WHERE account = '%u'", GetAccountId());
+ QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT count(*) AS r FROM character_tutorial WHERE account = '%u'", GetAccountId());
if(result)
- {
Rows = result->Fetch()[0].GetUInt32();
- delete result;
- }
if (Rows)
{