summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTannin <sherb@gmx.net>2016-05-11 20:12:14 +0200
committerTannin <sherb@gmx.net>2016-05-11 20:12:14 +0200
commit59a36107a1ba47b69c5016bf833922fbe5509e7c (patch)
tree246ce82f1865d6556ee20dc1b4fd7d8a445eef56
parentbc5d5d8bfa3f404389069e37bb03376f5930c256 (diff)
fixed crash when disabling mods
-rw-r--r--src/pluginlist.cpp8
1 files changed, 7 insertions, 1 deletions
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