]> git.saurik.com Git - wxWidgets.git/commit
Make wxSharedPtr::Release() really MT-safe.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 May 2013 23:20:58 +0000 (23:20 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 May 2013 23:20:58 +0000 (23:20 +0000)
commit43003176311ddbd6abaf0e5d15b0967506cb8d3b
tree63b3be4201cddaeba75ab47f5cc3d9a03d8816c7
parent3746766367bdca0a7f50c35d54e0d96f5de4ad55
Make wxSharedPtr::Release() really MT-safe.

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
docs/changes.txt
include/wx/sharedptr.h