diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index 559743742342a8cc62ced7ce4d089e0900c44dda..f9017c37524b9109285ce5a64cbe4a91534f99f9 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -68,6 +68,7 @@ CodepasterPlugin::CodepasterPlugin() CodepasterPlugin::~CodepasterPlugin() { + qDeleteAll(m_protocols); } bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_message) diff --git a/src/plugins/debugger/debuggeragents.cpp b/src/plugins/debugger/debuggeragents.cpp index 6f108cc9b9420c018c84ec885a49821a5aca4686..d29b5e506fcb4d88b2e4b3347d8f3b39060adf79 100644 --- a/src/plugins/debugger/debuggeragents.cpp +++ b/src/plugins/debugger/debuggeragents.cpp @@ -195,6 +195,8 @@ DisassemblerViewAgent::~DisassemblerViewAgent() if (d->editor) d->editor->deleteLater(); d->editor = 0; + delete d->locationMark; + d->locationMark = 0; delete d; d = 0; } diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 4819753fd37a1f9b549543ac660eb05637c19c13..679fec5005c4b04a6e176081c0751cada2314427 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -41,6 +41,7 @@ #include <QtCore/QDebug> #include <QtCore/QEvent> + #include <QtCore/QtAlgorithms> #include <QtCore/QTextStream> #include <QtCore/QTimer> @@ -361,6 +362,11 @@ WatchModel::WatchModel(WatchHandler *handler, WatchType type) } } +WatchModel::~WatchModel() +{ + delete m_root; +} + WatchItem *WatchModel::rootItem() const { return m_root; @@ -420,7 +426,7 @@ void WatchModel::removeOutdated() void WatchModel::removeOutdatedHelper(WatchItem *item) { if (item->generation < generationCounter) { - removeItem(item); + destroyItem(item); } else { foreach (WatchItem *child, item->children) removeOutdatedHelper(child); @@ -428,7 +434,7 @@ void WatchModel::removeOutdatedHelper(WatchItem *item) } } -void WatchModel::removeItem(WatchItem *item) +void WatchModel::destroyItem(WatchItem *item) { WatchItem *parent = item->parent; QModelIndex index = watchIndex(parent); @@ -437,6 +443,7 @@ void WatchModel::removeItem(WatchItem *item) beginRemoveRows(index, n, n); parent->children.removeAt(n); endRemoveRows(); + delete item; } static QString parentName(const QString &iname) @@ -1187,7 +1194,7 @@ void WatchHandler::removeData(const QString &iname) return; WatchItem *item = model->findItem(iname, model->m_root); if (item) - model->removeItem(item); + model->destroyItem(item); } void WatchHandler::watchExpression() @@ -1302,7 +1309,7 @@ void WatchHandler::removeWatchExpression(const QString &exp) m_watcherNames.remove(exp); foreach (WatchItem *item, m_watchers->rootItem()->children) { if (item->exp == exp) { - m_watchers->removeItem(item); + m_watchers->destroyItem(item); saveWatchers(); break; } diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 155d1de4116acca6962451e243c32e12775ef335..dfd36da559700d8349ec57bec9f24e6a9ba94e08 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -180,6 +180,7 @@ class WatchModel : public QAbstractItemModel private: explicit WatchModel(WatchHandler *handler, WatchType type); + virtual ~WatchModel(); QVariant data(const QModelIndex &index, int role) const; bool setData(const QModelIndex &index, const QVariant &value, int role); @@ -209,7 +210,7 @@ private: void removeOutdated(); void removeOutdatedHelper(WatchItem *item); WatchItem *rootItem() const; - void removeItem(WatchItem *item); + void destroyItem(WatchItem *item); void emitDataChanged(int column, const QModelIndex &parentIndex = QModelIndex()); diff --git a/src/plugins/projectexplorer/projectexplorersettings.h b/src/plugins/projectexplorer/projectexplorersettings.h index 995b4dface32a187bd5ff4baa3da56c32aa6ecdd..764340c1f87a04f9e05804b34b01684e4b68c071 100644 --- a/src/plugins/projectexplorer/projectexplorersettings.h +++ b/src/plugins/projectexplorer/projectexplorersettings.h @@ -35,18 +35,24 @@ namespace Internal { struct ProjectExplorerSettings { + ProjectExplorerSettings() : buildBeforeRun(true), saveBeforeBuild(false), + showCompilerOutput(false), useJom(true) {} + bool buildBeforeRun; bool saveBeforeBuild; bool showCompilerOutput; bool useJom; - bool operator==(const ProjectExplorerSettings &other) const { - return this->buildBeforeRun == other.buildBeforeRun - && this->saveBeforeBuild == other.saveBeforeBuild - && this->showCompilerOutput == other.showCompilerOutput - && this->useJom == other.useJom; - } }; +inline bool operator==(const ProjectExplorerSettings &p1, const ProjectExplorerSettings &p2) +{ + return p1.buildBeforeRun == p2.buildBeforeRun + && p1.saveBeforeBuild == p2.saveBeforeBuild + && p1.showCompilerOutput == p2.showCompilerOutput + && p1.useJom == p2.useJom; +} + + } // namespace ProjectExplorer } // namespace Internal diff --git a/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp b/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp index a45ebe44e27852f00e49f8bf62aab22773ad9c4c..74e9ceb0b61e8b96bdc68986ee4323bd254b8b75 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp @@ -132,8 +132,10 @@ S60Manager::S60Manager(QObject *parent) S60Manager::~S60Manager() { ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - for (int i = m_pluginObjects.size() - 1; i >= 0; i--) + for (int i = m_pluginObjects.size() - 1; i >= 0; i--) { pm->removeObject(m_pluginObjects.at(i)); + delete m_pluginObjects.at(i); + } } void S60Manager::addAutoReleasedObject(QObject *o)