Delete initializer, if it could not be stored.
This commit is contained in:
parent
cea3834ddf
commit
e3f5f0a801
@ -52,9 +52,9 @@ namespace MUtils
|
|||||||
{
|
{
|
||||||
if (T *const initializer = create())
|
if (T *const initializer = create())
|
||||||
{
|
{
|
||||||
if (m_data.testAndSetOrdered(NULL, initializer))
|
if (!m_data.testAndSetOrdered(NULL, initializer))
|
||||||
{
|
{
|
||||||
return *initializer;
|
delete initializer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user