Commit 67278ca3 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Valgrind fixes.



In Debugger and WelcomePageWidget.
Reviewed-by: default avatarDaniel Molkentin <daniel.molkentin@trolltech.com>
parent a4501441
......@@ -230,6 +230,7 @@ public:
m_startParameters(sp),
m_state(DebuggerNotReady),
m_lastGoodState(DebuggerNotReady),
m_targetState(DebuggerNotReady),
m_breakHandler(engine),
m_commandHandler(engine),
m_modulesHandler(engine),
......
......@@ -51,6 +51,7 @@
#include <QtCore/QTimer>
#include <QtCore/QSettings>
#include <QtCore/QXmlStreamReader>
#include <QtCore/QScopedPointer>
#include <QtGui/QDialogButtonBox>
#include <QtGui/QFont>
#include <QtGui/QMessageBox>
......@@ -169,7 +170,7 @@ void GettingStartedWelcomePageWidget::updateExamples(const QString &examplePath,
QMenu *cppMenu = new QMenu(ui->cppExamplesButton);
ui->cppExamplesButton->setMenu(cppMenu);
QMenu *subMenu = 0;
QScopedPointer<QMenu> subMenu;
bool inExamples = false;
QString dirName;
QXmlStreamReader reader(&description);
......@@ -182,7 +183,7 @@ void GettingStartedWelcomePageWidget::updateExamples(const QString &examplePath,
if (name.contains(QLatin1String("tutorial")))
break;
dirName = reader.attributes().value(QLatin1String("dirname")).toString();
subMenu = new QMenu(name);
subMenu.reset(new QMenu(name));
inExamples = true;
}
if (inExamples && reader.name() == QLatin1String("example")) {
......@@ -218,11 +219,8 @@ void GettingStartedWelcomePageWidget::updateExamples(const QString &examplePath,
break;
case QXmlStreamReader::EndElement:
if (reader.name() == QLatin1String("category")) {
if (subMenu->actions().isEmpty())
delete subMenu;
else
cppMenu->addMenu(subMenu);
if (!subMenu->actions().isEmpty())
cppMenu->addMenu(subMenu.take());
inExamples = false;
}
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment