mirror of
https://github.com/hyprwm/hyprutils.git
synced 2026-05-05 08:08:06 +02:00
memory: add missing lock
This commit is contained in:
parent
b074d4abc7
commit
172a3fc232
1 changed files with 1 additions and 0 deletions
|
|
@ -317,6 +317,7 @@ namespace Hyprutils::Memory {
|
|||
// not last ref?
|
||||
// -> must unlock AFTER reset
|
||||
auto& mutex = ((Atomic_::impl<T>*)m_ptr.impl_)->getMutex();
|
||||
mutex.lock();
|
||||
if (m_ptr.impl_->ref() == 0 && m_ptr.impl_->wref() == 1) {
|
||||
mutex.unlock();
|
||||
m_ptr.reset();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue