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 33
33
34
34
int main (int argc, char *argv[])
35
35
{
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
+ }
37
48
38
49
#ifndef Q_OS_DARWIN
39
50
Q_INIT_RESOURCE (SonicPi);
Original file line number Diff line number Diff line change @@ -3732,6 +3732,7 @@ void MainWindow::restartApp()
3732
3732
QApplication* app = dynamic_cast <QApplication*>(parent ());
3733
3733
statusBar ()->showMessage (tr (" Restarting Sonic Pi..." ), 10000 );
3734
3734
3735
+ qputenv (" SONIC_PI_RESTART" , " 1" );
3735
3736
// Save settings and perform some cleanup
3736
3737
writeSettings ();
3737
3738
onExitCleanup ();
You can’t perform that action at this time.
0 commit comments