diff --git a/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp b/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp index b556620c54f..38d8a282b2e 100644 --- a/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp +++ b/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp @@ -98,7 +98,8 @@ static SharedMemory *createSharedMemory(qint32 key, int byteCount) sharedMemory = new SharedMemory(QString(imageKeyTemplateString).arg(key)); bool sharedMemoryIsCreated = sharedMemory->create(byteCount); if (sharedMemoryIsCreated) { - globalSharedMemoryContainer()->insert(key, sharedMemory); + if (!globalSharedMemoryContainer()->insert(key, sharedMemory)) + return nullptr; } else { delete sharedMemory; sharedMemory = nullptr;