diff --git a/sources/genericpanel.cpp b/sources/genericpanel.cpp index dd4874d49..c5261df90 100644 --- a/sources/genericpanel.cpp +++ b/sources/genericpanel.cpp @@ -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); }