wxCritSection change to accomodate mem checking system
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1771 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -257,21 +257,26 @@ private:
|
|||||||
|
|
||||||
wxCriticalSection::wxCriticalSection()
|
wxCriticalSection::wxCriticalSection()
|
||||||
{
|
{
|
||||||
m_critsect = new wxCriticalSectionInternal;
|
m_critsect = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCriticalSection::~wxCriticalSection()
|
wxCriticalSection::~wxCriticalSection()
|
||||||
{
|
{
|
||||||
delete m_critsect;
|
if ( m_critsect )
|
||||||
|
delete m_critsect;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCriticalSection::Enter()
|
void wxCriticalSection::Enter()
|
||||||
{
|
{
|
||||||
|
m_critsect = new wxCriticalSectionInternal;
|
||||||
|
|
||||||
::EnterCriticalSection(*m_critsect);
|
::EnterCriticalSection(*m_critsect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCriticalSection::Leave()
|
void wxCriticalSection::Leave()
|
||||||
{
|
{
|
||||||
|
wxCHECK_RET( m_critsect, "Leave() without matching Enter()" );
|
||||||
|
|
||||||
::LeaveCriticalSection(*m_critsect);
|
::LeaveCriticalSection(*m_critsect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user