Using wxAtomicDec() is not enough, its result also must be checked as it will
return 0 only in one of the threads if multiple threads call it in parallel,
while the old test for m_count==0 could pass for more than one thread,
resulting in deleting the same pointer more than once.
Closes #15227.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74065
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- Add wxSocketBase::GetSocket() (Laurent Poujoulat).
- Add IEEE 754 single/double precision support to wxDataStream classes (net147).
- Add wxVector<>::const_reverse_iterator (troelsk).
- 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):
- Add Nepali translation (Him Prasad Gautam).
All (GUI):
- 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;
{
delete m_ref->m_ptr;
delete m_ref;