From 59a36107a1ba47b69c5016bf833922fbe5509e7c Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 11 May 2016 20:12:14 +0200 Subject: fixed crash when disabling mods --- src/pluginlist.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/pluginlist.cpp') diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 0622f729..1978c749 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -163,10 +163,16 @@ void PluginList::refresh(const QString &profileName for (const auto &espName : m_ESPsByName) { if (!availablePlugins.contains(espName.first)) { - m_ESPs.erase(m_ESPs.begin() + espName.second); + m_ESPs[espName.second].m_Name = ""; } } + m_ESPs.erase(std::remove_if(m_ESPs.begin(), m_ESPs.end(), + [](const ESPInfo &info) -> bool { + return info.m_Name.isEmpty(); + }), + m_ESPs.end()); + fixPriorities(); // functions in GamePlugins will use the IPluginList interface of this, so -- cgit v1.3.1