解决内存泄漏

This commit is contained in:
luoliangyi 2023-10-18 09:08:36 +08:00
parent f14e49bc54
commit 5536b0a932
2 changed files with 2 additions and 4 deletions

View File

@ -10,7 +10,7 @@ Dialog_AbnormalImage::Dialog_AbnormalImage(HGImage image, QWidget *parent) :
m_result = HGBASE_ERR_OK; m_result = HGBASE_ERR_OK;
m_view = new HGImgView(); m_view = new HGImgView(this);
m_view->addImage(image); m_view->addImage(image);
ui->stackedWidget->addWidget(m_view); ui->stackedWidget->addWidget(m_view);
ui->stackedWidget->setCurrentWidget(m_view); ui->stackedWidget->setCurrentWidget(m_view);

View File

@ -1316,9 +1316,7 @@ void MainWindow::on_newImage(void *image)
void MainWindow::on_abnormalImage(void *image, HGUInt *result) void MainWindow::on_abnormalImage(void *image, HGUInt *result)
{ {
HGImage img = nullptr; Dialog_AbnormalImage dlg((HGImage)image, this);
HGBase_CloneImage((HGImage)image, 0, 0, &img);
Dialog_AbnormalImage dlg(img, this);
dlg.exec(); dlg.exec();
*result = dlg.getResult(); *result = dlg.getResult();
} }