qt5base-lts/src
Thiago Macieira 4be50ecafd QTemporaryFile: fix issues with removing a file twice
The assertion in isUnnamedFile() we had was incorrect after the file was
removed, since we cleared the name and possibly reset back to the
template. Since ~QTemporaryFile() calls remove(), this was easy to
trigger if you attempted to remove the temp file and leave
QTemporaryFile like that.

Take this opportunity to add to the docs of setAutoRemove() explaining
the possibility of unnamed files.

#7  0x00007f69bcc2b50e in qt_assert (
    assertion=assertion@entry=0x7f69bcf194a0 "unnamedFile == d_func()->fileEntry.isEmpty()",
    file=file@entry=0x7f69bcf19458 "io/qtemporaryfile.cpp",
    line=line@entry=514) at global/qglobal.cpp:3123
#8  0x00007f69bcd672cf in QTemporaryFileEngine::isUnnamedFile (this=this@entry=0x55cd60644df0)
    at io/qtemporaryfile.cpp:514
#9  0x00007f69bcd683f7 in QTemporaryFileEngine::remove (this=0x55cd60644df0)
    at io/qtemporaryfile.cpp:396
#10 0x00007f69bcd48654 in QFile::remove (this=this@entry=0x7fffb393f7e0)
    at io/qfile.cpp:513
#11 0x00007f69bcd6653b in QTemporaryFile::~QTemporaryFile (this=0x7fffb393f7e0, __in_chrg=<optimized out>)
    at io/qtemporaryfile.cpp:719

Change-Id: I57a1bd6e0c194530b732fffd14f4ed28ca8185b2
Reviewed-by: Andreas Hartmetz <ahartmetz@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-23 05:27:23 +00:00
..
3rdparty Merge remote-tracking branch 'origin/5.9' into 5.10 2017-11-09 11:47:57 +01:00
android Merge remote-tracking branch 'origin/5.9.3' into 5.10.0 2017-11-21 10:58:21 +01:00
angle ANGLE: Fix compilation with MinGW 2017-10-16 15:47:03 +00:00
concurrent Doc: Update the list of highlighted examples 2017-11-22 07:39:53 +00:00
corelib QTemporaryFile: fix issues with removing a file twice 2017-11-23 05:27:23 +00:00
dbus Doc: Update the list of highlighted examples 2017-11-22 07:39:53 +00:00
gui Doc: Update the list of highlighted examples 2017-11-22 07:39:53 +00:00
network Doc: Update the list of highlighted examples 2017-11-22 07:39:53 +00:00
opengl Change almost all other uses of qrand() to QRandomGenerator 2017-11-08 09:14:03 +00:00
openglextensions Also release winmain, qopenglextensions under commercial licenses 2016-11-18 16:19:56 +00:00
platformheaders Merge remote-tracking branch 'origin/5.9' into dev 2017-04-20 12:31:27 +02:00
platformsupport Merge remote-tracking branch 'origin/5.9' into 5.10 2017-11-09 11:47:57 +01:00
plugins Merge 5.10 into 5.10.0 2017-11-20 13:48:33 +01:00
printsupport Printsupport: Not necessary to call setLayout when we added the parent 2017-10-12 16:45:05 +00:00
sql Fix BC breakage by adding an overload for the QSqlField constructor 2017-11-13 06:59:25 +00:00
testlib Merge remote-tracking branch 'origin/5.9' into 5.10 2017-11-09 11:47:57 +01:00
tools Merge remote-tracking branch 'origin/5.9' into 5.10 2017-10-30 08:54:05 +01:00
widgets Doc: Update the list of highlighted examples 2017-11-22 07:39:53 +00:00
winmain Merge remote-tracking branch 'origin/5.8' into 5.9 2017-02-08 15:49:18 +01:00
xml Prefer rvalue versions of toLatin() and toUtf8() 2017-03-30 20:31:59 +00:00
src.pro Merge remote-tracking branch 'origin/5.9' into dev 2017-03-28 09:28:31 +02:00