diff --git a/include/MUtils/Lazy.h b/include/MUtils/Lazy.h index 0040072..4c31051 100644 --- a/include/MUtils/Lazy.h +++ b/include/MUtils/Lazy.h @@ -52,9 +52,9 @@ namespace MUtils { if (T *const initializer = create()) { - if (m_data.testAndSetOrdered(NULL, initializer)) + if (!m_data.testAndSetOrdered(NULL, initializer)) { - return *initializer; + delete initializer; } } else