diff --git a/docs/changes.txt b/docs/changes.txt index f64bc4e691..4eba8dbd67 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -596,6 +596,7 @@ All: - Add wxSocketBase::GetSocket() (Laurent Poujoulat). - Add IEEE 754 single/double precision support to wxDataStream classes (net147). - Add wxVector<>::const_reverse_iterator (troelsk). +- Fix thread-safety issue in wxSharedPtr<> (plorkyeran). - Add Nepali translation (Him Prasad Gautam). All (GUI): diff --git a/include/wx/sharedptr.h b/include/wx/sharedptr.h index 279e29b3a3..290c610adc 100644 --- a/include/wx/sharedptr.h +++ b/include/wx/sharedptr.h @@ -115,8 +115,7 @@ private: { if (m_ref) { - wxAtomicDec( m_ref->m_count ); - if (m_ref->m_count == 0) + if (!wxAtomicDec( m_ref->m_count )) { delete m_ref->m_ptr; delete m_ref;