]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed assert when dumping a string which is locked for writing
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 20 Jul 2005 14:39:29 +0000 (14:39 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 20 Jul 2005 14:39:29 +0000 (14:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34894 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/debughlp.cpp

index ecd2d61246a0e55e92f0c376f772515d9c7e968b..8075dd672a85b53a4181becbb74cad72fbfe1c6a 100644 (file)
@@ -398,7 +398,11 @@ wxDbgHelpDLL::DumpUDT(PSYMBOL_INFO pSym, void *pVariable, unsigned level)
     if ( s == _T("wxString") )
     {
         wxString *ps = (wxString *)pVariable;
-        s << _T("(\"") << *ps << _T(")\"");
+
+        // take care to use c_str() here as otherwise we might hit an assert in
+        // wxString code if it is currently locked for writing (i.e. we're
+        // between GetWriteBuf() and UngetWriteBuf() calls)
+        s << _T("(\"") << ps->c_str() << _T(")\"");
     }
     else // any other UDT
 #endif // !wxUSE_STL