[ wxwindows-Patches-1857156 ] force debug information (MSW VC)

SourceForge.net noreply at sourceforge.net
Wed Jan 2 16:07:04 PST 2008


Patches item #1857156, was opened at 2007-12-23 20:55
Message generated for change (Comment added) made by vadz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1857156&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: MSW specific
Group: optimization
>Status: Closed
>Resolution: Rejected
Priority: 5
Private: No
Submitted By: Jes (sasha_m_)
Assigned to: Julian Smart (juliansmart)
Summary: force debug information (MSW VC)

Initial Comment:
with follow modification U can see in which line of souces contain memory leaks 
Index: C:/wxWidgets/include/wx/debug.h
===================================================================
--- C:/wxWidgets/include/wx/debug.h	(revision 50911)
+++ C:/wxWidgets/include/wx/debug.h	(working copy)
@@ -14,6 +14,10 @@
 #ifndef   _WX_DEBUG_H_
 #define   _WX_DEBUG_H_
 
+#ifdef _DEBUG
+	#define   _CRTDBG_MAP_ALLOC
+#endif
+
 #ifndef __WXWINCE__
 #include  <assert.h>
 #endif

Index: C:/wxWidgets/include/wx/wx.h
===================================================================
--- C:/wxWidgets/include/wx/wx.h	(revision 50911)
+++ C:/wxWidgets/include/wx/wx.h	(working copy)
@@ -104,4 +104,10 @@
 
 #endif // wxUSE_GUI
 
+#ifdef _DEBUG
+	#ifdef __WXMSW__
+		#include "wx/msw/msvcrt.h"
+	#endif
+#endif
+
 #endif // _WX_WX_H_

Index: C:/wxWidgets/src/common/dummy.cpp
===================================================================
--- C:/wxWidgets/src/common/dummy.cpp	(revision 50911)
+++ C:/wxWidgets/src/common/dummy.cpp	(working copy)
@@ -23,9 +23,9 @@
     #pragma hdrstop
 #endif
 
-#ifdef __WXMSW__
-    #include "wx/msw/msvcrt.h"
-#endif
+//#ifdef __WXMSW__
+//    #include "wx/msw/msvcrt.h"
+//#endif
 
 #ifdef __VISAGECPP__
     char wxDummyChar = 0;



----------------------------------------------------------------------

>Comment By: Vadim Zeitlin (vadz)
Date: 2008-01-03 01:07

Message:
Logged In: YES 
user_id=71618
Originator: NO

Sorry, but there are several problems with this patch:

1. It doesn't help with tracking the leaks of objects allocated with new,
see http://support.microsoft.com/kb/q140858/ (linked from wx/msw/msvcrt.h)

2. It breaks compilation with at least MSVC 7.1 because re-defining new as
we do it in wx/msw/msvcrt.h breaks the headers included after it

So unfortunately it can't be applied.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1857156&group_id=9863




More information about the wx-dev mailing list