diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2010-02-11 14:39:56 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond@trolltech.com> | 2010-02-11 14:42:59 (GMT) |
commit | d9a6d2e28e4a38ff1242e5e9b1d2225844a51a00 (patch) | |
tree | bc3193e4cd2856555f5f08ad7e7d7f33c397bdee /src/gui | |
parent | a35186a00ed789ac98c193c4ded2bab62f2a018a (diff) | |
download | Qt-d9a6d2e28e4a38ff1242e5e9b1d2225844a51a00.zip Qt-d9a6d2e28e4a38ff1242e5e9b1d2225844a51a00.tar.gz Qt-d9a6d2e28e4a38ff1242e5e9b1d2225844a51a00.tar.bz2 |
Make QCUPSSupport::printerHasPPD() clean up after itself.
This call "leaked" a temporary file in /tmp every time a QPrinter object
was created. Not very nice at all.
Task-number: QTBUG-6419
Reviewed-by: Kim
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qcups.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/painting/qcups.cpp b/src/gui/painting/qcups.cpp index 7903762..ac41692 100644 --- a/src/gui/painting/qcups.cpp +++ b/src/gui/painting/qcups.cpp @@ -342,7 +342,9 @@ bool QCUPSSupport::printerHasPPD(const char *printerName) { if (!isAvailable()) return false; - return _cupsGetPPD(printerName) != 0; + const char *ppdFile = _cupsGetPPD(printerName); + unlink(ppdFile); + return (ppdFile != 0); } QString QCUPSSupport::unicodeString(const char *s) |