From 7a3bc0cd23e637d66a1f78809f7229e665391cdb Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Fri, 4 Dec 2020 13:33:14 +0100 Subject: Throw exception when trying to unload the current game plugin. --- src/plugincontainer.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/plugincontainer.cpp') diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp index a2f0d5f0..c3d66913 100644 --- a/src/plugincontainer.cpp +++ b/src/plugincontainer.cpp @@ -850,6 +850,11 @@ void PluginContainer::loadPlugin(QString const& filepath) void PluginContainer::unloadPlugin(MOBase::IPlugin* plugin, QObject* object) { if (auto* game = qobject_cast(object)) { + + if (game == managedGame()) { + throw Exception("cannot unload the plugin for the currently managed game"); + } + unregisterGame(game); } -- cgit v1.3.1