Reset LazyInit#m_Initializer once not needed anymore

... to save memory.

refs #7752
This commit is contained in:
Alexander A. Klimov 2020-04-08 17:45:33 +02:00
parent 63a6584ccb
commit fbc2184a37

View File

@ -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)();
}
}