]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/memory.cpp
blind fix for XTI compilation after last change
[wxWidgets.git] / src / common / memory.cpp
index 0d67e157e0a040035a76ba781d2ee3558f54deda..a6a4a32d50488188dc45ce1f198f57159455eeaa 100644 (file)
@@ -892,6 +892,9 @@ public:
     MemoryCriticalSection() {
         memSectionOk = true;
     }
+    ~MemoryCriticalSection() {
+        memSectionOk = false;
+    }
 };
 
 class MemoryCriticalSectionLocker
@@ -910,10 +913,12 @@ private:
     bool m_locked;
 };
 
-    static MemoryCriticalSection memLocker;
+static MemoryCriticalSection memLocker;
 
 #endif
 
+#ifdef __WXDEBUG__
+#if wxUSE_GLOBAL_MEMORY_OPERATORS
 void * operator new (size_t size, wxChar * fileName, int lineNum)
 {
     return wxDebugAlloc(size, fileName, lineNum, false, false);
@@ -1056,6 +1061,9 @@ void wxDebugFree(void * buf, bool WXUNUSED(isVect) )
     free((char *)st);
 }
 
+#endif // wxUSE_GLOBAL_MEMORY_OPERATORS
+#endif // __WXDEBUG__
+
 // Trace: send output to the current debugging stream
 void wxTrace(const wxChar * ...)
 {
@@ -1134,11 +1142,11 @@ void wxTraceLevel(int, const wxChar * ...)
 }
 
 //----------------------------------------------------------------------------
-// Final cleanup after all global objects in all files have been destructed
+// Final cleanup after all global objects in all files have been destroyed
 //----------------------------------------------------------------------------
 
 // Don't set it to 0 by dynamic initialization
-// Some compilers will realy do the asignment later
+// Some compilers will really do the assignment later
 // All global variables are initialized to 0 at the very beginning, and this is just fine.
 int wxDebugContextDumpDelayCounter::sm_count;
 
@@ -1153,7 +1161,7 @@ void wxDebugContextDumpDelayCounter::DoDump()
 }
 
 // Even if there is nothing else, make sure that there is at
-// least one clenup counter object
+// least one cleanup counter object
 static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_One;
 
 #endif // (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT