diff options
| author | Tom Tanner <thosrtanner2@users.sourceforge.net> | 2015-03-22 10:49:15 +0000 |
|---|---|---|
| committer | Tom Tanner <thosrtanner2@users.sourceforge.net> | 2015-03-22 10:49:15 +0000 |
| commit | ea520baf4e4a512744552a8528e3b41145796151 (patch) | |
| tree | e9bf9269c075004fe69352ce29e739f5619b335c | |
| parent | a9cec9e5e230dbd56d62ae6dd517ae10252125ae (diff) | |
Fix a meory leak with modules that error during loading
More Sconscript stuff
| -rw-r--r-- | src/SConscript | 4 | ||||
| -rw-r--r-- | src/plugincontainer.cpp | 4 | ||||
| -rw-r--r-- | src/savegamegamebyro.h | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/SConscript b/src/SConscript index 3dd5d450..1d69c1d6 100644 --- a/src/SConscript +++ b/src/SConscript @@ -66,9 +66,9 @@ env.AppendUnique(CPPDEFINES = [ '_UNICODE',
'_CRT_SECURE_NO_WARNINGS',
'_SCL_SECURE_NO_WARNINGS',
- 'NOMINMAX',
'BOOST_DISABLE_ASSERTS',
- 'NDEBUG'
+ 'NDEBUG',
+ 'QT_MESSAGELOGCONTEXT'
])
env.AppendUnique(CPPFLAGS = [ '-wd4100', '-wd4127', '-wd4512', '-wd4189' ])
diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp index 6bc9d12b..e1d9d9f0 100644 --- a/src/plugincontainer.cpp +++ b/src/plugincontainer.cpp @@ -266,7 +266,7 @@ void PluginContainer::loadPlugins() loadCheck.flush();
QString pluginName = iter.filePath();
if (QLibrary::isLibrary(pluginName)) {
- QPluginLoader *pluginLoader = new QPluginLoader(pluginName, this);
+ std::unique_ptr<QPluginLoader> pluginLoader(new QPluginLoader(pluginName, this));
if (pluginLoader->instance() == nullptr) {
m_FailedPlugins.push_back(pluginName);
qCritical("failed to load plugin %s: %s",
@@ -274,7 +274,7 @@ void PluginContainer::loadPlugins() } else {
if (registerPlugin(pluginLoader->instance(), pluginName)) {
qDebug("loaded plugin \"%s\"", qPrintable(pluginName));
- m_PluginLoaders.push_back(pluginLoader);
+ m_PluginLoaders.push_back(pluginLoader.release());
} else {
m_FailedPlugins.push_back(pluginName);
qWarning("plugin \"%s\" failed to load", qPrintable(pluginName));
diff --git a/src/savegamegamebyro.h b/src/savegamegamebyro.h index eedda6c2..e08e1044 100644 --- a/src/savegamegamebyro.h +++ b/src/savegamegamebyro.h @@ -22,10 +22,9 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include "savegame.h"
-#include <gameinfo.h>
+
#include <QString>
#include <QObject>
-#include <QImage>
#include <QMetaType>
#include <QFile>
|
