From: Vadim Zeitlin Date: Wed, 20 Jul 2005 14:39:29 +0000 (+0000) Subject: fixed assert when dumping a string which is locked for writing X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b903802e0838d2a5de8be099c8d764147fcc624c fixed assert when dumping a string which is locked for writing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34894 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/debughlp.cpp b/src/msw/debughlp.cpp index ecd2d61246..8075dd672a 100644 --- a/src/msw/debughlp.cpp +++ b/src/msw/debughlp.cpp @@ -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