Fix crash

When a qetgraphicstable is deleted, the next and previous table is not
aware about the deletion and keep a dangled pointer of the deleted table
who cause a segfault.
This commit is contained in:
joshua 2021-06-24 19:15:24 +02:00
parent d7a49b9e74
commit 13041720df

View File

@ -156,7 +156,17 @@ QetGraphicsTableItem::QetGraphicsTableItem(QGraphicsItem *parent) :
}
QetGraphicsTableItem::~QetGraphicsTableItem()
{}
{
if (m_previous_table) {
if (m_next_table) {
m_previous_table->setNextTable(m_next_table);
} else {
m_previous_table->setNextTable(nullptr);
}
} else if (m_next_table) {
m_next_table->setPreviousTable(nullptr);
}
}
/**
@brief QetGraphicsTableItem::setModel