mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-28 08:27:32 -04:00
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.
This commit is contained in:
parent
58b6fb36f8
commit
d7cbec1a02
1 changed files with 3 additions and 2 deletions
|
@ -108,9 +108,10 @@ Config* Config::instance()
|
||||||
void Config::createTempFileInstance()
|
void Config::createTempFileInstance()
|
||||||
{
|
{
|
||||||
Q_ASSERT(!m_instance);
|
Q_ASSERT(!m_instance);
|
||||||
QTemporaryFile* tmpFile = new QTemporaryFile(qApp);
|
QTemporaryFile* tmpFile = new QTemporaryFile();
|
||||||
bool openResult = tmpFile->open();
|
bool openResult = tmpFile->open();
|
||||||
Q_ASSERT(openResult);
|
Q_ASSERT(openResult);
|
||||||
Q_UNUSED(openResult);
|
Q_UNUSED(openResult);
|
||||||
m_instance = new Config(tmpFile->fileName(), tmpFile);
|
m_instance = new Config(tmpFile->fileName(), qApp);
|
||||||
|
tmpFile->setParent(m_instance);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue