add a critical section protecting ms_prev variables (replaces patch 1819224)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-10-24 17:59:53 +00:00
parent 2064113c9d
commit a2d3826500
2 changed files with 7 additions and 0 deletions

View File

@@ -460,6 +460,8 @@ void WXDLLEXPORT wxVLogSysError(unsigned long err, const wxString& format, va_li
/* static */
void wxLog::LogLastRepetitionCountIfNeeded()
{
wxCRIT_SECT_LOCKER(lock, ms_prevCS);
wxLog *pLogger = GetActiveTarget();
if ( pLogger && ms_prevCounter )
{
@@ -494,6 +496,8 @@ void wxLog::OnLog(wxLogLevel level, const wxString& szString, time_t t)
{
if ( GetRepetitionCounting() )
{
wxCRIT_SECT_LOCKER(lock, ms_prevCS);
if ( szString == ms_prevString )
{
ms_prevCounter++;