From d7cbec1a02771b213da38a6249603032503d084c Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sun, 28 Oct 2012 18:07:23 +0100 Subject: [PATCH] Make sure that TestGui doesn't leave a temp file behind. Swap the parent/child relationship between QTemporaryFile and Config because the QTemporaryFile dtor is called before its chidren are destroyed. --- src/core/Config.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/Config.cpp b/src/core/Config.cpp index ac5752de5..fba625299 100644 --- a/src/core/Config.cpp +++ b/src/core/Config.cpp @@ -108,9 +108,10 @@ Config* Config::instance() void Config::createTempFileInstance() { Q_ASSERT(!m_instance); - QTemporaryFile* tmpFile = new QTemporaryFile(qApp); + QTemporaryFile* tmpFile = new QTemporaryFile(); bool openResult = tmpFile->open(); Q_ASSERT(openResult); Q_UNUSED(openResult); - m_instance = new Config(tmpFile->fileName(), tmpFile); + m_instance = new Config(tmpFile->fileName(), qApp); + tmpFile->setParent(m_instance); }