File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 3333
3434int main (int argc, char *argv[])
3535{
36- std::cout << " Starting Sonic Pi..." << std::endl;
36+ if (qgetenv (" SONIC_PI_RESTART" ) != " " )
37+ {
38+ std::cout << " Restarting Sonic Pi..." << std::endl;
39+ // Pause for a couple of seconds to enable the previous instance
40+ // of Sonic Pi to complete before starting this new replacement
41+ // instance. This is to ensure that the two processes don't
42+ // conflict with the SingleApplication constraint.
43+ QThread::msleep (2000 );
44+ } else
45+ {
46+ std::cout << " Starting Sonic Pi..." << std::endl;
47+ }
3748
3849#ifndef Q_OS_DARWIN
3950 Q_INIT_RESOURCE (SonicPi);
Original file line number Diff line number Diff line change @@ -3732,6 +3732,7 @@ void MainWindow::restartApp()
37323732 QApplication* app = dynamic_cast <QApplication*>(parent ());
37333733 statusBar ()->showMessage (tr (" Restarting Sonic Pi..." ), 10000 );
37343734
3735+ qputenv (" SONIC_PI_RESTART" , " 1" );
37353736 // Save settings and perform some cleanup
37363737 writeSettings ();
37373738 onExitCleanup ();
You can’t perform that action at this time.
0 commit comments