mirror of
https://github.com/ea4k/klog.git
synced 2024-09-21 02:18:32 +00:00
Merge pull request #732 from ikbenkous/fixdoublefree
Fix double free in mainwindow.cpp (#726)
This commit is contained in:
commit
51438b48a5
@ -192,8 +192,7 @@ MainWindow::MainWindow(const QString &tversion)
|
||||
mainWidget = new QWidget(this);
|
||||
//qDebug() << Q_FUNC_INFO << ": 60 " << QTime::currentTime().toString("hh:mm:ss") ;
|
||||
|
||||
dateTime = new QDateTime();
|
||||
dateTimeTemp = new QDateTime();
|
||||
dateTime = std::make_unique<QDateTime>();
|
||||
// UI DX
|
||||
infoLabel2 = new QLabel(tr("DX Entity"));
|
||||
loggWinAct = new QAction(tr("&Log Window"), this);
|
||||
@ -251,8 +250,7 @@ MainWindow::~MainWindow()
|
||||
delete(locator);
|
||||
delete(qso);
|
||||
delete(backupQSO);
|
||||
delete(dateTime);
|
||||
delete(dateTimeTemp);
|
||||
dateTime.reset();
|
||||
delete(awards);
|
||||
delete(softUpdate);
|
||||
delete(filemanager);
|
||||
@ -2219,7 +2217,6 @@ void MainWindow::slotClearButtonClicked(const QString &_func)
|
||||
setModifying(false);
|
||||
|
||||
currentEntity = -1;
|
||||
dateTimeTemp = dateTime;
|
||||
modifyingQSO = -1;
|
||||
|
||||
QSOTabWidget->setRSTToMode(mainQSOEntryWidget->getMode(), readingTheUI);
|
||||
@ -4687,8 +4684,6 @@ void MainWindow::qsoToEdit (const int _qso)
|
||||
|
||||
mainQSOEntryWidget->setDateTime(qsoE.getDateTimeOn());
|
||||
|
||||
dateTimeTemp->setDate(qsoE.getDate());
|
||||
|
||||
mainQSOEntryWidget->setBand(qsoE.getBand());
|
||||
|
||||
//qDebug() << Q_FUNC_INFO << " - RST" ;
|
||||
|
@ -81,6 +81,8 @@
|
||||
#include "updatesettings.h"
|
||||
#include "klogdefinitions.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class QTimer;
|
||||
class QDateTime;
|
||||
|
||||
@ -627,7 +629,7 @@ private:
|
||||
// </UI>
|
||||
int infoTimeout; // timeout that temporary info will stay in the infobars
|
||||
QTimer *timer, *timerInfoBars;
|
||||
QDateTime *dateTime, *dateTimeTemp;
|
||||
std::unique_ptr<QDateTime> dateTime;
|
||||
bool yearChangedDuringModification;
|
||||
QString infoLabel1T, infoLabel2T;
|
||||
|
||||
|
@ -156,7 +156,6 @@ void tst_MainWindow::test_Constructor()
|
||||
QVERIFY2(mainWindow->qso, "qso not created");
|
||||
//QVERIFY2(mainWindow->debugFile, "debugFile not created");
|
||||
QVERIFY2(mainWindow->dateTime, "dateTime not created");
|
||||
QVERIFY2(mainWindow->dateTimeTemp, "dateTimeTemp not created");
|
||||
QVERIFY2(mainWindow->awards, "awards not created");
|
||||
QVERIFY2(mainWindow->softUpdate, "softUpdate not created");
|
||||
QVERIFY2(mainWindow->filemanager, "filemanager not created");
|
||||
|
Loading…
Reference in New Issue
Block a user