mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-20 15:39:58 +01:00
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:
@@ -156,7 +156,17 @@ QetGraphicsTableItem::QetGraphicsTableItem(QGraphicsItem *parent) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
QetGraphicsTableItem::~QetGraphicsTableItem()
|
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
|
@brief QetGraphicsTableItem::setModel
|
||||||
|
|||||||
Reference in New Issue
Block a user