forked from qt-creator/qt-creator
Fix some memory leaks
Task-number: QTCREATORBUG-7645 Change-Id: I34253d063a20ebf927bf651cf68af4fe1b71bc89 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -233,6 +233,11 @@ HistoryCompleter::HistoryCompleter(QSettings *settings, QObject *parent)
|
|||||||
view->setItemDelegate(delegate);
|
view->setItemDelegate(delegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HistoryCompleter::~HistoryCompleter()
|
||||||
|
{
|
||||||
|
delete d;
|
||||||
|
}
|
||||||
|
|
||||||
int HistoryCompleter::historySize() const
|
int HistoryCompleter::historySize() const
|
||||||
{
|
{
|
||||||
return d->model->rowCount();
|
return d->model->rowCount();
|
||||||
|
@@ -49,6 +49,7 @@ class QTCREATOR_UTILS_EXPORT HistoryCompleter : public QCompleter
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
HistoryCompleter(QSettings *settings, QObject *parent);
|
HistoryCompleter(QSettings *settings, QObject *parent);
|
||||||
|
~HistoryCompleter();
|
||||||
int historySize() const;
|
int historySize() const;
|
||||||
int maximalHistorySize() const;
|
int maximalHistorySize() const;
|
||||||
void setMaximalHistorySize(int numberOfEntries);
|
void setMaximalHistorySize(int numberOfEntries);
|
||||||
|
@@ -665,7 +665,7 @@ void AnalyzerManagerPrivate::addTool(IAnalyzerTool *tool, const StartModes &mode
|
|||||||
QString actionName = tool->actionName(mode);
|
QString actionName = tool->actionName(mode);
|
||||||
Id menuGroup = tool->menuGroup(mode);
|
Id menuGroup = tool->menuGroup(mode);
|
||||||
Id actionId = tool->actionId(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));
|
Command *command = Core::ActionManager::registerAction(action, actionId, Context(C_GLOBAL));
|
||||||
m_menu->addAction(command, menuGroup);
|
m_menu->addAction(command, menuGroup);
|
||||||
command->action()->setData(int(StartLocal));
|
command->action()->setData(int(StartLocal));
|
||||||
|
@@ -1757,7 +1757,9 @@ ExtensionSystem::IPlugin::ShutdownFlag FakeVimPlugin::aboutToShutdown()
|
|||||||
void FakeVimPlugin::extensionsInitialized()
|
void FakeVimPlugin::extensionsInitialized()
|
||||||
{
|
{
|
||||||
d->m_statusBar = new Core::StatusBarWidget;
|
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);
|
d->m_statusBar->setPosition(StatusBarWidget::Last);
|
||||||
addAutoReleasedObject(d->m_statusBar);
|
addAutoReleasedObject(d->m_statusBar);
|
||||||
}
|
}
|
||||||
|
@@ -379,6 +379,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
this, SLOT(updateWelcomePage()));
|
this, SLOT(updateWelcomePage()));
|
||||||
|
|
||||||
d->m_proWindow = new ProjectWindow;
|
d->m_proWindow = new ProjectWindow;
|
||||||
|
addAutoReleasedObject(d->m_proWindow);
|
||||||
|
|
||||||
Core::Context globalcontext(Core::Constants::C_GLOBAL);
|
Core::Context globalcontext(Core::Constants::C_GLOBAL);
|
||||||
Core::Context projecTreeContext(Constants::C_PROJECT_TREE);
|
Core::Context projecTreeContext(Constants::C_PROJECT_TREE);
|
||||||
|
@@ -54,6 +54,7 @@ public:
|
|||||||
CodeStylePoolPrivate()
|
CodeStylePoolPrivate()
|
||||||
: m_factory(0)
|
: m_factory(0)
|
||||||
{}
|
{}
|
||||||
|
~CodeStylePoolPrivate();
|
||||||
|
|
||||||
QString generateUniqueId(const QString &id) const;
|
QString generateUniqueId(const QString &id) const;
|
||||||
|
|
||||||
@@ -65,6 +66,11 @@ public:
|
|||||||
QString m_settingsPath;
|
QString m_settingsPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CodeStylePoolPrivate::~CodeStylePoolPrivate()
|
||||||
|
{
|
||||||
|
delete m_factory;
|
||||||
|
}
|
||||||
|
|
||||||
QString CodeStylePoolPrivate::generateUniqueId(const QString &id) const
|
QString CodeStylePoolPrivate::generateUniqueId(const QString &id) const
|
||||||
{
|
{
|
||||||
if (!id.isEmpty() && !m_idToCodeStyle.contains(id))
|
if (!id.isEmpty() && !m_idToCodeStyle.contains(id))
|
||||||
|
@@ -126,11 +126,13 @@ private:
|
|||||||
QHBoxLayout * buttonLayout;
|
QHBoxLayout * buttonLayout;
|
||||||
QList<QObject*> m_pluginList;
|
QList<QObject*> m_pluginList;
|
||||||
int m_activePlugin;
|
int m_activePlugin;
|
||||||
|
NetworkAccessManagerFactory *m_networkAccessManagerFactory;
|
||||||
};
|
};
|
||||||
|
|
||||||
// --- WelcomeMode
|
// --- WelcomeMode
|
||||||
WelcomeMode::WelcomeMode() :
|
WelcomeMode::WelcomeMode() :
|
||||||
m_activePlugin(0)
|
m_activePlugin(0)
|
||||||
|
, m_networkAccessManagerFactory(new NetworkAccessManagerFactory)
|
||||||
{
|
{
|
||||||
setDisplayName(tr("Welcome"));
|
setDisplayName(tr("Welcome"));
|
||||||
setIcon(QIcon(QLatin1String(Core::Constants::ICON_QTLOGO_32)));
|
setIcon(QIcon(QLatin1String(Core::Constants::ICON_QTLOGO_32)));
|
||||||
@@ -181,6 +183,7 @@ WelcomeMode::~WelcomeMode()
|
|||||||
QSettings *settings = Core::ICore::settings();
|
QSettings *settings = Core::ICore::settings();
|
||||||
settings->setValue(QLatin1String(currentPageSettingsKeyC), activePlugin());
|
settings->setValue(QLatin1String(currentPageSettingsKeyC), activePlugin());
|
||||||
delete m_modeWidget;
|
delete m_modeWidget;
|
||||||
|
delete m_networkAccessManagerFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sortFunction(Utils::IWelcomePage * a, Utils::IWelcomePage *b)
|
bool sortFunction(Utils::IWelcomePage * a, Utils::IWelcomePage *b)
|
||||||
@@ -235,7 +238,7 @@ void WelcomeMode::initPlugins()
|
|||||||
engine->setImportPathList(importPathList);
|
engine->setImportPathList(importPathList);
|
||||||
if (!debug)
|
if (!debug)
|
||||||
engine->setOutputWarningsToStandardError(false);
|
engine->setOutputWarningsToStandardError(false);
|
||||||
engine->setNetworkAccessManagerFactory(new NetworkAccessManagerFactory);
|
engine->setNetworkAccessManagerFactory(m_networkAccessManagerFactory);
|
||||||
QString pluginPath = QCoreApplication::applicationDirPath();
|
QString pluginPath = QCoreApplication::applicationDirPath();
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
pluginPath += QLatin1String("/../PlugIns");
|
pluginPath += QLatin1String("/../PlugIns");
|
||||||
|
Reference in New Issue
Block a user