mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-01 07:14:14 +02:00
Merge pull request #1162 from ispyisail/fix/terminal-strip-dock-use-after-free
Fix a crash when closing a project after its terminal strip window is gone
This commit is contained in:
@@ -62,7 +62,9 @@ void TerminalStripTreeDockWidget::setProject(QETProject *project)
|
||||
}
|
||||
m_project = project;
|
||||
if (m_project) {
|
||||
m_project_destroy_connection = connect(m_project, &QObject::destroyed, [this](){
|
||||
//`this` as context: this dock can be deleted before the project
|
||||
//(with the editor window that owns it), and the connection must go with it
|
||||
m_project_destroy_connection = connect(m_project, &QObject::destroyed, this, [this](){
|
||||
this->m_current_strip.clear();
|
||||
this->reload();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user