From fbc2184a3706e2c569b0c558026ab8bcfd5c73b3 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 8 Apr 2020 17:45:33 +0200 Subject: [PATCH] Reset LazyInit#m_Initializer once not needed anymore ... to save memory. refs #7752 --- lib/base/lazy-init.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/base/lazy-init.hpp b/lib/base/lazy-init.hpp index c1da2cd93..ae2a87afc 100644 --- a/lib/base/lazy-init.hpp +++ b/lib/base/lazy-init.hpp @@ -55,6 +55,7 @@ public: if (ptr == nullptr) { ptr = new T(m_Initializer()); m_Underlying.store(ptr, std::memory_order_release); + m_Initializer = decltype(m_Initializer)(); } }