mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-15 09:17:28 -05: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
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user