# HG changeset patch # User John W. Eaton # Date 1619816064 14400 # Node ID d11dfe2813fa6f70bbf04917dc5d0193ea71629e # Parent 0023c109e1b07afec9ee773dfcf00b8f57362499 avoid possible crash when closing variable editor sub-window * variable-editor.cc (variable_editor::edit_variable): Use old-style signal/slot connection to connect QApplication::focusChanged signal to variable_dock_widget::handle_focus_change slot. diff -r 0023c109e1b0 -r d11dfe2813fa libgui/src/variable-editor.cc --- a/libgui/src/variable-editor.cc Sun May 02 07:28:15 2021 -0700 +++ b/libgui/src/variable-editor.cc Fri Apr 30 16:54:24 2021 -0400 @@ -1228,8 +1228,11 @@ page->setObjectName (name); m_main->addDockWidget (Qt::LeftDockWidgetArea, page); - connect (qApp, &QApplication::focusChanged, - page, &variable_dock_widget::handle_focus_change); + // The old-style signal/slot connection appears to be needed here to + // prevent a crash when closing a variable_dock_widget object. + connect (qApp, SIGNAL (focusChanged (QWidget*, QWidget*)), + page, SLOT (handle_focus_change (QWidget*, QWidget*))); + connect (page, &variable_dock_widget::destroyed, this, &variable_editor::variable_destroyed); connect (page, &variable_dock_widget::variable_focused_signal,