2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Fix base::binary_guard.

This commit is contained in:
John Preston
2018-08-27 14:35:41 +03:00
parent 5824afa941
commit a58c082cfa

View File

@@ -57,10 +57,10 @@ inline void binary_guard::kill() {
}
inline void binary_guard::destroy() {
if (_bothAlive) {
if (const auto both = base::take(_bothAlive)) {
auto old = true;
if (!_bothAlive->compare_exchange_strong(old, false)) {
delete _bothAlive;
if (!both->compare_exchange_strong(old, false)) {
delete both;
}
}
}