mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-26 02:21:43 +08:00
FIXED: using QSharedPointer for automatic memory management
This commit is contained in:
parent
d4930d7729
commit
591f0dfe64
@ -3922,14 +3922,14 @@ bool JKQTBasePlotter::saveAsSVG(const QString& filename, bool displayPreview) {
|
|||||||
QString tempFM="";
|
QString tempFM="";
|
||||||
if (QFile::exists(fn)) {
|
if (QFile::exists(fn)) {
|
||||||
#ifdef QFWIDLIB_LIBRARY
|
#ifdef QFWIDLIB_LIBRARY
|
||||||
QFTemporaryFile* tf=new QFTemporaryFile();
|
QSharedPointer<QFTemporaryFile> tf=QSharedPointer<QFTemporaryFile>(new QFTemporaryFile());
|
||||||
#else
|
#else
|
||||||
QTemporaryFile* tf=new QTemporaryFile();
|
QSharedPointer<QTemporaryFile> tf=QSharedPointer<QTemporaryFile>(new QTemporaryFile());
|
||||||
#endif
|
#endif
|
||||||
tf->open();
|
tf->open();
|
||||||
tempFM=tf->fileName();
|
tempFM=tf->fileName();
|
||||||
tf->close();
|
tf->close();
|
||||||
delete tf;
|
tf.reset();
|
||||||
QFile::copy(fn, tempFM);
|
QFile::copy(fn, tempFM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user