From 9ce3b0d9535a666ff05dea9bd4a6982c162ca9f8 Mon Sep 17 00:00:00 2001 From: David Faure Date: Sat, 1 Feb 2014 10:57:36 +0100 Subject: qdoc: fix memory leaks, unchecked open(), hardcoded path - in debugging code Change-Id: I3b065dd18f60214a858543d062dfb2f0f1dc1b36 Reviewed-by: Laurent Montel Reviewed-by: Oswald Buddenhagen Reviewed-by: Martin Smith --- src/tools/qdoc/generator.cpp | 11 +++++------ 1 file 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 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::ConstIterator i = outFileNames.begin(); while (i != outFileNames.end()) { - (*filesout) << i.key() << "\n"; + filesout << i.key() << "\n"; ++i; } - filesout->flush(); - files->close(); } /*! -- cgit v1.2.3