comparison libgui/src/main-window.cc @ 21428:217e6e97085b

Prevent race conditions in GUI and interpreter initialization (bug #47326) * main-window.cc (main_window::execute_octave_interpreter): New slot. (main_window::construct_octave_qt_link): Defer starting the interpreter thread until after the QApplication main loop is running. * main-window.h (main_window::execute_octave_interpreter): Declare new slot.
author Mike Miller <mtmiller@octave.org>
date Thu, 10 Mar 2016 12:11:17 -0800
parents 309bba07a4f6
children 912b8828193b
comparison
equal deleted inserted replaced
21427:067662ac6bfe 21428:217e6e97085b
1581 1581
1582 connect (command_window, SIGNAL (interrupt_signal (void)), 1582 connect (command_window, SIGNAL (interrupt_signal (void)),
1583 _octave_qt_link, SLOT (terminal_interrupt (void))); 1583 _octave_qt_link, SLOT (terminal_interrupt (void)));
1584 } 1584 }
1585 1585
1586 octave_link::connect_link (_octave_qt_link);
1587
1588 // Defer initializing and executing the interpreter until after the main
1589 // window and QApplication are running to prevent race conditions
1590 QTimer::singleShot (0, this, SLOT (execute_octave_interpreter ()));
1591 }
1592
1593 void
1594 main_window::execute_octave_interpreter (void)
1595 {
1586 _octave_qt_link->execute_interpreter (); 1596 _octave_qt_link->execute_interpreter ();
1587
1588 octave_link::connect_link (_octave_qt_link);
1589 } 1597 }
1590 1598
1591 void 1599 void
1592 main_window::construct_menu_bar (void) 1600 main_window::construct_menu_bar (void)
1593 { 1601 {