增加vld检测memleak
parent
9a5d784283
commit
b28c28f425
|
@ -33,6 +33,13 @@ FORMS += \
|
|||
|
||||
LIBS += -lws2_32
|
||||
|
||||
INCLUDEPATH += $$PWD/../../SDK/include
|
||||
|
||||
CONFIG(debug, debug|debug) {
|
||||
INCLUDEPATH += "D:/Visual Leak Detector/include"
|
||||
win32:LIBS += "D:/Visual Leak Detector/lib/Win64/vld.lib"
|
||||
}
|
||||
|
||||
TRANSLATIONS += \
|
||||
EmsShower_en_US.ts
|
||||
CONFIG += lrelease
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
#ifdef _DEBUG
|
||||
#include <vld.h>
|
||||
#endif
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
@ -10,9 +14,11 @@ int main(int argc, char *argv[])
|
|||
|
||||
QTranslator translator;
|
||||
const QStringList uiLanguages = QLocale::system().uiLanguages();
|
||||
for (const QString &locale : uiLanguages) {
|
||||
for (const QString &locale : uiLanguages)
|
||||
{
|
||||
const QString baseName = "EmsShower_" + QLocale(locale).name();
|
||||
if (translator.load(":/i18n/" + baseName)) {
|
||||
if (translator.load(":/i18n/" + baseName))
|
||||
{
|
||||
a.installTranslator(&translator);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -116,6 +116,12 @@ MainWindow::~MainWindow()
|
|||
ptr = nullptr;
|
||||
}
|
||||
m_SlaveData.clear();
|
||||
|
||||
if (m_pSettings!=nullptr)
|
||||
{
|
||||
delete m_pSettings;
|
||||
m_pSettings = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::getConfiguration(QString iniFilePath)
|
||||
|
@ -311,6 +317,7 @@ bool MainWindow::readRegister(int addr,int nb,uint16_t* dest)
|
|||
}
|
||||
|
||||
qDebug() << "同步读取地址" << pItem->start_address;
|
||||
delete pDevice;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue