From 6357bc3dad4e987afc4fcd9cf4aa2ac6009c6a49 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Thu, 18 Jun 2020 15:13:02 +0400 Subject: [PATCH] Catch MyGUI exceptions in the FontLoader destructor --- components/fontloader/fontloader.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/fontloader/fontloader.cpp b/components/fontloader/fontloader.cpp index 6dcebe0bdd..605d552435 100644 --- a/components/fontloader/fontloader.cpp +++ b/components/fontloader/fontloader.cpp @@ -165,7 +165,14 @@ namespace Gui FontLoader::~FontLoader() { - MyGUI::ResourceManager::getInstance().unregisterLoadXmlDelegate("Resource"); + try + { + MyGUI::ResourceManager::getInstance().unregisterLoadXmlDelegate("Resource"); + } + catch(const MyGUI::Exception& e) + { + Log(Debug::Error) << "Error in the FontLoader destructor: " << e.what(); + } for (std::vector::iterator it = mTextures.begin(); it != mTextures.end(); ++it) delete *it;