mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-03 09:14:12 +02:00
Merge pull request #1231 from ispyisail/fix/projects-panel-close-use-after-free
Fix a crash when closing QElectroTech without saving an edited project
This commit is contained in:
@@ -696,7 +696,13 @@ QTreeWidgetItem *GenericPanel::updateItem(QTreeWidgetItem *qtwi,
|
||||
bool freshly_created) {
|
||||
Q_UNUSED(options);
|
||||
Q_UNUSED(freshly_created);
|
||||
QApplication::processEvents();
|
||||
//No QApplication::processEvents() here. It dates from when this
|
||||
//panel also listed the whole element collection, to keep the
|
||||
//window alive while that reloaded; the collection has its own
|
||||
//panel now. Running the event loop from inside the panel's own
|
||||
//methods let a pending deleteLater() destroy the panel while
|
||||
//addProject() was still using it: closing QElectroTech without
|
||||
//saving an edited project read freed memory.
|
||||
return(qtwi);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user