From d0f2c4fcf79222d5c6f3c17188a811b0a47833c6 Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 17 Jul 2013 20:58:58 +0200 Subject: - now avoids a few unnecessary copy operations during generation of the directory structure - bugfix: circular dependency caused a memory leak - bugfix: removing a single mod lead to the wrong mod being deleted --- src/pluginlist.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/pluginlist.cpp') diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index df132287..61069c2f 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -116,10 +116,10 @@ void PluginList::refresh(const QString &profileName, const DirectoryEntry &baseD m_CurrentProfile = profileName; - std::vector files = baseDirectory.getFiles(); + std::vector files = baseDirectory.getFiles(); for (auto iter = files.begin(); iter != files.end(); ++iter) { - FileEntry *current = *iter; - if (current == NULL) { + FileEntry::Ptr current = *iter; + if (current.get() == NULL) { continue; } QString filename = ToQString(current->getName()); @@ -450,8 +450,8 @@ bool PluginList::saveLoadOrder(DirectoryEntry &directoryStructure) for (std::vector::iterator iter = m_ESPs.begin(); iter != m_ESPs.end(); ++iter) { std::wstring espName = ToWString(iter->m_Name); - const FileEntry *fileEntry = directoryStructure.findFile(espName); - if (fileEntry != NULL) { + const FileEntry::Ptr fileEntry = directoryStructure.findFile(espName); + if (fileEntry.get() != NULL) { QString fileName; bool archive = false; int originid = fileEntry->getOrigin(archive); -- cgit v1.3.1