summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2014-02-01 10:57:36 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-10 11:00:41 +0100
commit9ce3b0d9535a666ff05dea9bd4a6982c162ca9f8 (patch)
treeb573cec50b4992c0573044c8c5b576e65077ea67
parent5c9d671bfb5b5111069aadc9bf3f742f369c74ae (diff)
downloadqtbase-9ce3b0d9535a666ff05dea9bd4a6982c162ca9f8.tar.gz
qtbase-9ce3b0d9535a666ff05dea9bd4a6982c162ca9f8.tar.bz2
qtbase-9ce3b0d9535a666ff05dea9bd4a6982c162ca9f8.zip
qdoc: fix memory leaks, unchecked open(), hardcoded path - in debugging code
Change-Id: I3b065dd18f60214a858543d062dfb2f0f1dc1b36 Reviewed-by: Laurent Montel <laurent.montel@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
-rw-r--r--src/tools/qdoc/generator.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index b14a79dfab..71c550d4ab 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -246,16 +246,15 @@ QMultiMap<QString,QString> outFileNames;
*/
void Generator::writeOutFileNames()
{
- QFile* files = new QFile("/Users/msmith/depot/qt5/qtdoc/outputlist.txt");
- files->open(QFile::WriteOnly);
- QTextStream* filesout = new QTextStream(files);
+ QFile files("outputlist.txt");
+ if (!files.open(QFile::WriteOnly))
+ return;
+ QTextStream filesout(&files);
QMultiMap<QString,QString>::ConstIterator i = outFileNames.begin();
while (i != outFileNames.end()) {
- (*filesout) << i.key() << "\n";
+ filesout << i.key() << "\n";
++i;
}
- filesout->flush();
- files->close();
}
/*!