Check pointer to prevent memory leak.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-02-18 09:03:24 +02:00
parent d038a22aa3
commit 7b23e89237
3 changed files with 6 additions and 0 deletions

View file

@ -453,6 +453,8 @@ QTreeWidgetItem *DialogMDataBase::AddGroup(const QString &text)
//---------------------------------------------------------------------------------------------------------------------
void DialogMDataBase::AddMeasurement(QTreeWidgetItem *group, const QString &name, const QStringList &list)
{
SCASSERT(group != nullptr)
QTreeWidgetItem *m = new QTreeWidgetItem(group);
if (selectMode)

View file

@ -180,6 +180,8 @@ void TapeConfigDialog::createIcons()
//---------------------------------------------------------------------------------------------------------------------
void TapeConfigDialog::createIcon(const QString &icon, const QString &text)
{
SCASSERT(contentsWidget != nullptr)
QListWidgetItem *button = new QListWidgetItem(contentsWidget);
button->setIcon(QIcon(icon));
button->setText(text);

View file

@ -181,6 +181,8 @@ void ConfigDialog::createIcons()
//---------------------------------------------------------------------------------------------------------------------
void ConfigDialog::createIcon(const QString &icon, const QString &text)
{
SCASSERT(contentsWidget != nullptr)
QListWidgetItem *button = new QListWidgetItem(contentsWidget);
button->setIcon(QIcon(icon));
button->setText(text);