From 9ea2ac92ef083ffc6aec117edd3c86e5b312c68e Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sun, 17 Feb 2019 17:24:36 -0800 Subject: [PATCH] Fix wxCriticalSectionLocker usage A temporary object will not hold the lock --- src/propgrid/propgrid.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 5faa8b9d40..72b88c0fce 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -516,7 +516,7 @@ wxPropertyGrid::~wxPropertyGrid() size_t i; #if wxUSE_THREADS - wxCriticalSectionLocker(wxPGGlobalVars->m_critSect); + wxCriticalSectionLocker lock(wxPGGlobalVars->m_critSect); #endif // @@ -6368,7 +6368,7 @@ void wxPropertyGridEvent::OnPropertyGridSet() return; #if wxUSE_THREADS - wxCriticalSectionLocker(wxPGGlobalVars->m_critSect); + wxCriticalSectionLocker lock(wxPGGlobalVars->m_critSect); #endif m_pg->m_liveEvents.push_back(this); } @@ -6380,7 +6380,7 @@ wxPropertyGridEvent::~wxPropertyGridEvent() if ( m_pg ) { #if wxUSE_THREADS - wxCriticalSectionLocker(wxPGGlobalVars->m_critSect); + wxCriticalSectionLocker lock(wxPGGlobalVars->m_critSect); #endif // Use iterate from the back since it is more likely that the event