diff options
author | Orgad Shaneh <orgads@gmail.com> | 2012-07-19 22:26:45 +0300 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-07-20 09:13:09 +0200 |
commit | cf9895ae0146456b034c50459e2aa81299483b4d (patch) | |
tree | deeab3a3bc71fcf7412783f7a7f12e6cf5692d30 /src | |
parent | ebc63659c120abd02f7a0b5f70a9f896cacf907d (diff) | |
download | qt-creator-cf9895ae0146456b034c50459e2aa81299483b4d.tar.gz |
Fix some memory leaks
Task-number: QTCREATORBUG-7645
Change-Id: I34253d063a20ebf927bf651cf68af4fe1b71bc89
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/utils/historycompleter.cpp | 5 | ||||
-rw-r--r-- | src/libs/utils/historycompleter.h | 1 | ||||
-rw-r--r-- | src/plugins/analyzerbase/analyzermanager.cpp | 2 | ||||
-rw-r--r-- | src/plugins/fakevim/fakevimplugin.cpp | 4 | ||||
-rw-r--r-- | src/plugins/projectexplorer/projectexplorer.cpp | 1 | ||||
-rw-r--r-- | src/plugins/texteditor/codestylepool.cpp | 6 | ||||
-rw-r--r-- | src/plugins/welcome/welcomeplugin.cpp | 5 |
7 files changed, 21 insertions, 3 deletions
diff --git a/src/libs/utils/historycompleter.cpp b/src/libs/utils/historycompleter.cpp index 3f684ea8ed..6b39051e6e 100644 --- a/src/libs/utils/historycompleter.cpp +++ b/src/libs/utils/historycompleter.cpp @@ -233,6 +233,11 @@ HistoryCompleter::HistoryCompleter(QSettings *settings, QObject *parent) view->setItemDelegate(delegate); } +HistoryCompleter::~HistoryCompleter() +{ + delete d; +} + int HistoryCompleter::historySize() const { return d->model->rowCount(); diff --git a/src/libs/utils/historycompleter.h b/src/libs/utils/historycompleter.h index 76db9346de..c5927aa6a6 100644 --- a/src/libs/utils/historycompleter.h +++ b/src/libs/utils/historycompleter.h @@ -49,6 +49,7 @@ class QTCREATOR_UTILS_EXPORT HistoryCompleter : public QCompleter public: HistoryCompleter(QSettings *settings, QObject *parent); + ~HistoryCompleter(); int historySize() const; int maximalHistorySize() const; void setMaximalHistorySize(int numberOfEntries); diff --git a/src/plugins/analyzerbase/analyzermanager.cpp b/src/plugins/analyzerbase/analyzermanager.cpp index 4f2feffe6b..2761c8e3aa 100644 --- a/src/plugins/analyzerbase/analyzermanager.cpp +++ b/src/plugins/analyzerbase/analyzermanager.cpp @@ -665,7 +665,7 @@ void AnalyzerManagerPrivate::addTool(IAnalyzerTool *tool, const StartModes &mode QString actionName = tool->actionName(mode); Id menuGroup = tool->menuGroup(mode); Id actionId = tool->actionId(mode); - QAction *action = new QAction(actionName, 0); + QAction *action = new QAction(actionName, this); Command *command = Core::ActionManager::registerAction(action, actionId, Context(C_GLOBAL)); m_menu->addAction(command, menuGroup); command->action()->setData(int(StartLocal)); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 5e07f126cd..20d5b43a43 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -1757,7 +1757,9 @@ ExtensionSystem::IPlugin::ShutdownFlag FakeVimPlugin::aboutToShutdown() void FakeVimPlugin::extensionsInitialized() { d->m_statusBar = new Core::StatusBarWidget; - d->m_statusBar->setWidget(new MiniBuffer); + MiniBuffer *miniBuffer = new MiniBuffer; + addAutoReleasedObject(miniBuffer); + d->m_statusBar->setWidget(miniBuffer); d->m_statusBar->setPosition(StatusBarWidget::Last); addAutoReleasedObject(d->m_statusBar); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 6fcb31e4b6..f17705bf41 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -379,6 +379,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er this, SLOT(updateWelcomePage())); d->m_proWindow = new ProjectWindow; + addAutoReleasedObject(d->m_proWindow); Core::Context globalcontext(Core::Constants::C_GLOBAL); Core::Context projecTreeContext(Constants::C_PROJECT_TREE); diff --git a/src/plugins/texteditor/codestylepool.cpp b/src/plugins/texteditor/codestylepool.cpp index 83bd00656a..8220c156e4 100644 --- a/src/plugins/texteditor/codestylepool.cpp +++ b/src/plugins/texteditor/codestylepool.cpp @@ -54,6 +54,7 @@ public: CodeStylePoolPrivate() : m_factory(0) {} + ~CodeStylePoolPrivate(); QString generateUniqueId(const QString &id) const; @@ -65,6 +66,11 @@ public: QString m_settingsPath; }; +CodeStylePoolPrivate::~CodeStylePoolPrivate() +{ + delete m_factory; +} + QString CodeStylePoolPrivate::generateUniqueId(const QString &id) const { if (!id.isEmpty() && !m_idToCodeStyle.contains(id)) diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 9dcf2ce465..c056611189 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -126,11 +126,13 @@ private: QHBoxLayout * buttonLayout; QList<QObject*> m_pluginList; int m_activePlugin; + NetworkAccessManagerFactory *m_networkAccessManagerFactory; }; // --- WelcomeMode WelcomeMode::WelcomeMode() : m_activePlugin(0) + , m_networkAccessManagerFactory(new NetworkAccessManagerFactory) { setDisplayName(tr("Welcome")); setIcon(QIcon(QLatin1String(Core::Constants::ICON_QTLOGO_32))); @@ -181,6 +183,7 @@ WelcomeMode::~WelcomeMode() QSettings *settings = Core::ICore::settings(); settings->setValue(QLatin1String(currentPageSettingsKeyC), activePlugin()); delete m_modeWidget; + delete m_networkAccessManagerFactory; } bool sortFunction(Utils::IWelcomePage * a, Utils::IWelcomePage *b) @@ -235,7 +238,7 @@ void WelcomeMode::initPlugins() engine->setImportPathList(importPathList); if (!debug) engine->setOutputWarningsToStandardError(false); - engine->setNetworkAccessManagerFactory(new NetworkAccessManagerFactory); + engine->setNetworkAccessManagerFactory(m_networkAccessManagerFactory); QString pluginPath = QCoreApplication::applicationDirPath(); #ifdef Q_OS_MAC pluginPath += QLatin1String("/../PlugIns"); |