mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-25 10:01:38 +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="";
|
||||
if (QFile::exists(fn)) {
|
||||
#ifdef QFWIDLIB_LIBRARY
|
||||
QFTemporaryFile* tf=new QFTemporaryFile();
|
||||
QSharedPointer<QFTemporaryFile> tf=QSharedPointer<QFTemporaryFile>(new QFTemporaryFile());
|
||||
#else
|
||||
QTemporaryFile* tf=new QTemporaryFile();
|
||||
QSharedPointer<QTemporaryFile> tf=QSharedPointer<QTemporaryFile>(new QTemporaryFile());
|
||||
#endif
|
||||
tf->open();
|
||||
tempFM=tf->fileName();
|
||||
tf->close();
|
||||
delete tf;
|
||||
tf.reset();
|
||||
QFile::copy(fn, tempFM);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user