check for wxOnAssert reentrancy
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12274 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -313,19 +313,6 @@ void ShowAssertDialog(const wxChar *szFile, int nLine, const wxChar *szMsg)
|
|||||||
{
|
{
|
||||||
// this variable can be set to true to suppress "assert failure" messages
|
// this variable can be set to true to suppress "assert failure" messages
|
||||||
static bool s_bNoAsserts = FALSE;
|
static bool s_bNoAsserts = FALSE;
|
||||||
static bool s_bInAssert = FALSE; // FIXME MT-unsafe
|
|
||||||
|
|
||||||
if ( s_bInAssert )
|
|
||||||
{
|
|
||||||
// He-e-e-e-elp!! we're trapped in endless loop
|
|
||||||
wxTrap();
|
|
||||||
|
|
||||||
s_bInAssert = FALSE;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
s_bInAssert = TRUE;
|
|
||||||
|
|
||||||
wxChar szBuf[4096];
|
wxChar szBuf[4096];
|
||||||
|
|
||||||
@@ -396,13 +383,26 @@ void ShowAssertDialog(const wxChar *szFile, int nLine, const wxChar *szMsg)
|
|||||||
wxTrap();
|
wxTrap();
|
||||||
#endif // GUI/!GUI
|
#endif // GUI/!GUI
|
||||||
}
|
}
|
||||||
|
|
||||||
s_bInAssert = FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// this function is called when an assert fails
|
// this function is called when an assert fails
|
||||||
void wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg)
|
void wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg)
|
||||||
{
|
{
|
||||||
|
// FIXME MT-unsafe
|
||||||
|
static bool s_bInAssert = FALSE;
|
||||||
|
|
||||||
|
if ( s_bInAssert )
|
||||||
|
{
|
||||||
|
// He-e-e-e-elp!! we're trapped in endless loop
|
||||||
|
wxTrap();
|
||||||
|
|
||||||
|
s_bInAssert = FALSE;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
s_bInAssert = TRUE;
|
||||||
|
|
||||||
if ( !wxTheApp )
|
if ( !wxTheApp )
|
||||||
{
|
{
|
||||||
// by default, show the assert dialog box - we can't customize this
|
// by default, show the assert dialog box - we can't customize this
|
||||||
@@ -414,6 +414,8 @@ void wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg)
|
|||||||
// let the app process it as it wants
|
// let the app process it as it wants
|
||||||
wxTheApp->OnAssert(szFile, nLine, szMsg);
|
wxTheApp->OnAssert(szFile, nLine, szMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s_bInAssert = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxAppBase::OnAssert(const wxChar *file, int line, const wxChar *msg)
|
void wxAppBase::OnAssert(const wxChar *file, int line, const wxChar *msg)
|
||||||
|
Reference in New Issue
Block a user