diff --git a/components/fontloader/fontloader.cpp b/components/fontloader/fontloader.cpp index 09bf0b190..2bed079e1 100644 --- a/components/fontloader/fontloader.cpp +++ b/components/fontloader/fontloader.cpp @@ -593,7 +593,7 @@ namespace Gui if (createCopy) { - MyGUI::xml::ElementPtr copy = _node->createCopy(); + std::unique_ptr copy{_node->createCopy()}; MyGUI::xml::ElementEnumerator copyFont = copy->getElementEnumerator(); while (copyFont.next("Resource")) @@ -629,8 +629,7 @@ namespace Gui } } - MyGUI::ResourceManager::getInstance().loadFromXmlNode(copy, _file, _version); - delete copy; + MyGUI::ResourceManager::getInstance().loadFromXmlNode(copy.get(), _file, _version); } }