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:
ispyisail
2026-10-02 16:59:45 +13:00
committed by GitHub
+7 -1
View File
@@ -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);
}