From 824f54c15fae44519ff52a30bec3d16f892ac2e7 Mon Sep 17 00:00:00 2001 From: APTX Date: Sat, 28 Apr 2018 18:36:27 +0900 Subject: [PATCH] Catch any errors that occur during feature plugin loading --- core/instancemanager.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/instancemanager.cpp b/core/instancemanager.cpp index 746b2f9..6bc3d2d 100644 --- a/core/instancemanager.cpp +++ b/core/instancemanager.cpp @@ -150,7 +150,15 @@ Player *InstanceManager::createPlayerInstance() { auto player = new Player{instance, this}; Q_CHECK_PTR(player); - m_featurePluginManager->forEach([player]( - FeaturePluginBase *plugin) { plugin->createInstance(player, player); }); + m_featurePluginManager->forEach( + [player](FeaturePluginBase *plugin) { + try { + plugin->createInstance(player, player); + } catch (const std::exception &ex) { + qCWarning(imCategory) + << "Failed to create instance of feature plugin instance. Error:" + << ex.what(); + } + }); return player; } -- 2.52.0