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