13
0

Fix ctrl surface shutdown sequence

Tear down GUI before stopping event loop, this fixes
a crash on windows (and perhaps a rare crash on other OS).
This commit is contained in:
Robin Gareus 2024-07-11 19:19:21 +02:00
parent 676b372ac5
commit fa6fbbf810
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
5 changed files with 8 additions and 6 deletions

View File

@ -61,11 +61,11 @@ Console1::~Console1 ()
{ {
all_lights_out (); all_lights_out ();
tear_down_gui ();
stop_event_loop (); stop_event_loop ();
MIDISurface::drop (); MIDISurface::drop ();
tear_down_gui ();
for (const auto& b : buttons) { for (const auto& b : buttons) {
delete b.second; delete b.second;
} }

View File

@ -167,7 +167,6 @@ GenericMidiControlProtocol::~GenericMidiControlProtocol ()
} }
drop_all (); drop_all ();
tear_down_gui ();
} }
list<std::shared_ptr<ARDOUR::Bundle> > list<std::shared_ptr<ARDOUR::Bundle> >
@ -300,6 +299,7 @@ GenericMidiControlProtocol::do_request (GenericMIDIRequest* req)
int int
GenericMidiControlProtocol::stop () GenericMidiControlProtocol::stop ()
{ {
tear_down_gui ();
BaseUI::quit (); BaseUI::quit ();
return 0; return 0;
@ -328,6 +328,7 @@ GenericMidiControlProtocol::set_active (bool yn)
if (yn) { if (yn) {
BaseUI::run (); BaseUI::run ();
} else { } else {
tear_down_gui ();
BaseUI::quit (); BaseUI::quit ();
} }

View File

@ -189,8 +189,8 @@ LaunchPadPro::~LaunchPadPro ()
p.second.timeout_connection.disconnect (); p.second.timeout_connection.disconnect ();
} }
stop_event_loop ();
tear_down_gui (); tear_down_gui ();
stop_event_loop ();
MIDISurface::drop (); MIDISurface::drop ();

View File

@ -193,8 +193,8 @@ LaunchPadX::~LaunchPadX ()
p.second.timeout_connection.disconnect (); p.second.timeout_connection.disconnect ();
} }
stop_event_loop ();
tear_down_gui (); tear_down_gui ();
stop_event_loop ();
MIDISurface::drop (); MIDISurface::drop ();

View File

@ -138,7 +138,6 @@ OSC::~OSC()
{ {
tick = false; tick = false;
stop (); stop ();
tear_down_gui ();
_instance = 0; _instance = 0;
} }
@ -315,6 +314,8 @@ OSC::thread_init ()
int int
OSC::stop () OSC::stop ()
{ {
tear_down_gui ();
periodic_connection.disconnect (); periodic_connection.disconnect ();
session_connections.drop_connections (); session_connections.drop_connections ();