mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Invert logic of CAtomicFile destructor:
abandon changes if destruction is due to an exception, instead of applying changes if destruction is NOT due to an exception. Because otherwise QFile destructor will apply changes regardless, by calling the close method via virtual dispatch.
This commit is contained in:
@@ -35,7 +35,7 @@ namespace BlackMisc
|
||||
CAtomicFile(const QString &filename) : QFile(filename) {}
|
||||
|
||||
//! \copydoc QFile::~QFile
|
||||
~CAtomicFile() { if (! std::uncaught_exception()) { close(); } }
|
||||
~CAtomicFile() { if (std::uncaught_exception()) { QFile::close(); } }
|
||||
|
||||
//! \copydoc QFile::open
|
||||
//! Just before opening the file, the filename is changed so we actually write to a temporary file.
|
||||
|
||||
Reference in New Issue
Block a user