Fix leak of file descriptors in QTemporaryFile
authorJoão Abecasis <joao@abecasis.name>
Wed, 6 May 2009 14:12:57 +0000 (16:12 +0200)
committerJoão Abecasis <joao@abecasis.name>
Fri, 8 May 2009 11:28:34 +0000 (13:28 +0200)
commit42e2070925d012845db9cf85e597a17851a0dcb6
tree5b1ab555c9b554027a3daf55e1e848e20a7ca974
parentf64bcba9338928107bb4bfc1282b94aa2f696557
Fix leak of file descriptors in QTemporaryFile

Using setFileName in QFile::copy (introduced recently) has a nasty
side-effect of leaking file descriptors in QTemporaryFile. This happens
because the code assumes the file has been closed. In QTemporaryFile,
we need to explicitly call native file engine close.

Test case by Thiago. Bug report from Arora developers.

Reviewed-by: thiago
src/corelib/io/qtemporaryfile.cpp
tests/auto/qtemporaryfile/qtemporaryfile.pro
tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp