delayed destruction of global memLocker object

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27095 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Dimitri Schoolwerth
2004-05-04 14:19:30 +00:00
parent 5624a7c21f
commit 3d2eaa5d59

View File

@@ -910,14 +910,19 @@ private:
bool m_locked;
};
static MemoryCriticalSection memLocker;
MemoryCriticalSection &GetMemLocker()
{
static MemoryCriticalSection memLocker;
return memLocker;
}
#endif
// TODO: store whether this is a vector or not.
void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject, bool WXUNUSED(isVect) )
{
#if USE_THREADSAFE_MEMORY_ALLOCATION
MemoryCriticalSectionLocker lock(memLocker);
MemoryCriticalSectionLocker lock(GetMemLocker());
#endif
// If not in debugging allocation mode, do the normal thing
@@ -977,7 +982,7 @@ void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject,
void wxDebugFree(void * buf, bool WXUNUSED(isVect) )
{
#if USE_THREADSAFE_MEMORY_ALLOCATION
MemoryCriticalSectionLocker lock(memLocker);
MemoryCriticalSectionLocker lock(GetMemLocker());
#endif
if (!buf)