From 545aadebb1125fdc5118ca0f556ea4887d74b6a4 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 16 Jul 2026 11:22:50 +0200 Subject: kstd: fix memory leak in weak_ptr --- libs/kstd/kstd/bits/shared_ptr.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/kstd/kstd/bits/shared_ptr.hpp b/libs/kstd/kstd/bits/shared_ptr.hpp index 99301cbe..33d52e1c 100644 --- a/libs/kstd/kstd/bits/shared_ptr.hpp +++ b/libs/kstd/kstd/bits/shared_ptr.hpp @@ -185,7 +185,7 @@ namespace kstd { if (m_control_block) { - if (!m_control_block->weak_count.fetch_sub(1)) + if (!--m_control_block->weak_count) { delete m_control_block; m_control_block = nullptr; -- cgit v1.2.3