diff --git a/include/hyprutils/memory/SharedPtr.hpp b/include/hyprutils/memory/SharedPtr.hpp index ec9df70..8cc8ee2 100644 --- a/include/hyprutils/memory/SharedPtr.hpp +++ b/include/hyprutils/memory/SharedPtr.hpp @@ -169,13 +169,7 @@ namespace Hyprutils { } ~CSharedPointer() { - // we do not decrement here, - // because we want to preserve the pointer - // in case this is the last owner. - if (impl_ && impl_->ref() == 1) - destroyImpl(); - else - decrement(); + decrement(); } template