mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02: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:
parent
d7a49b9e74
commit
13041720df
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user