mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 19:06:49 +01:00
[8318] Deleted as expected runnable objects at related Thread deleting for avoid memory leaks. Author: VladimirMangos
[8319] Restore compile PGSQL support after last changes. Author: ApoC --HG-- branch : trunk
This commit is contained in:
@@ -41,7 +41,7 @@ class TRINITY_DLL_SPEC Database
|
||||
|
||||
TransactionQueues m_tranQueues; ///< Transaction queues from diff. threads
|
||||
QueryQueues m_queryQueues; ///< Query queues from diff threads
|
||||
SqlDelayThread* m_threadBody; ///< Pointer to delay sql executer
|
||||
SqlDelayThread* m_threadBody; ///< Pointer to delay sql executer (owned by m_delayThread)
|
||||
ACE_Based::Thread* m_delayThread; ///< Pointer to executer thread
|
||||
|
||||
public:
|
||||
|
||||
@@ -440,8 +440,8 @@ void DatabaseMysql::InitDelayThread()
|
||||
assert(!m_delayThread);
|
||||
|
||||
//New delay thread for delay execute
|
||||
m_threadBody = new MySQLDelayThread(this);
|
||||
m_delayThread = new ACE_Based::Thread(*m_threadBody);
|
||||
m_threadBody = new MySQLDelayThread(this); // will deleted at m_delayThread delete
|
||||
m_delayThread = new ACE_Based::Thread(m_threadBody);
|
||||
}
|
||||
|
||||
void DatabaseMysql::HaltDelayThread()
|
||||
|
||||
@@ -366,8 +366,8 @@ void DatabasePostgre::InitDelayThread()
|
||||
assert(!m_delayThread);
|
||||
|
||||
//New delay thread for delay execute
|
||||
m_threadBody = new PGSQLDelayThread(this);
|
||||
m_delayThread = new ACE_Based::Thread(*m_threadBody);
|
||||
m_threadBody = new PGSQLDelayThread(this); // Will be deleted on m_delayThread delete
|
||||
m_delayThread = new ACE_Based::Thread(m_threadBody);
|
||||
}
|
||||
|
||||
void DatabasePostgre::HaltDelayThread()
|
||||
|
||||
@@ -101,7 +101,7 @@ Thread::Thread() : m_task(0), m_iThreadId(0), m_hThreadHandle(0)
|
||||
|
||||
}
|
||||
|
||||
Thread::Thread(Runnable& instance) : m_task(&instance), m_iThreadId(0), m_hThreadHandle(0)
|
||||
Thread::Thread(Runnable* instance) : m_task(instance), m_iThreadId(0), m_hThreadHandle(0)
|
||||
{
|
||||
bool _start = start();
|
||||
ASSERT (_start);
|
||||
@@ -110,6 +110,9 @@ Thread::Thread(Runnable& instance) : m_task(&instance), m_iThreadId(0), m_hThrea
|
||||
Thread::~Thread()
|
||||
{
|
||||
//Wait();
|
||||
|
||||
// deleted runnable object (owned by Thread)
|
||||
delete m_task;
|
||||
}
|
||||
|
||||
//initialize Thread's class static member
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace ACE_Based
|
||||
{
|
||||
public:
|
||||
Thread();
|
||||
Thread(Runnable& instance);
|
||||
explicit Thread(Runnable* instance);
|
||||
~Thread();
|
||||
|
||||
bool start();
|
||||
|
||||
Reference in New Issue
Block a user