diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-16 18:56:36 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-16 18:56:36 +0200 |
commit | d71c3ca30ea79d6a54446be8c5a9da169d7ccd1e (patch) | |
tree | 0fb292bea536aa80f06e35b9b6877f1ce0a02153 /compat/borrowed-ptr.cpp | |
parent | 54a90fdfe41abfefca1a4e28969c6e4eff93bd83 (diff) |
w
Diffstat (limited to 'compat/borrowed-ptr.cpp')
-rw-r--r-- | compat/borrowed-ptr.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compat/borrowed-ptr.cpp b/compat/borrowed-ptr.cpp index 3048e48a..1dded12a 100644 --- a/compat/borrowed-ptr.cpp +++ b/compat/borrowed-ptr.cpp @@ -10,8 +10,11 @@ void control_block::decrement(control_block*& blk) noexcept { delete blk->_ptr; blk->_ptr = nullptr; +#ifdef FM_NO_WEAK_BPTR + delete blk; +#endif } - +#ifndef FM_NO_WEAK_BPTR auto c = --blk->_soft_count; fm_bptr_assert(c != (uint32_t)-1); if (c == 0) @@ -19,9 +22,11 @@ void control_block::decrement(control_block*& blk) noexcept fm_bptr_assert(!blk->_ptr); delete blk; } +#endif blk = nullptr; } +#ifndef FM_NO_WEAK_BPTR void control_block::weak_decrement(control_block*& blk) noexcept { if (!blk) @@ -36,6 +41,7 @@ void control_block::weak_decrement(control_block*& blk) noexcept } blk = nullptr; } +#endif } // namespace floormat::detail_bptr |