1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 07:39:42 +02:00

Bug2437: Call finishLaunching() before sleeping

This commit is contained in:
Paul Licameli 2020-12-09 17:34:17 -05:00
parent d8cd8041f1
commit 57134d93d6

View File

@ -1278,13 +1278,15 @@ bool AudacityApp::OnInit()
// opened. So use CallAfter() to delay the rest of initialization. // opened. So use CallAfter() to delay the rest of initialization.
// See CreateSingleInstanceChecker() where we send those paths over a // See CreateSingleInstanceChecker() where we send those paths over a
// socket to the prior instance. // socket to the prior instance.
// This call is what probably makes the sleep unnecessary:
MacFinishLaunching();
using namespace std::chrono; using namespace std::chrono;
// This sleep may be unnecessary, but it is harmless. It less NS framework // This sleep may be unnecessary, but it is harmless. It less NS framework
// events arrive on another thread, but it might not always be long enough. // events arrive on another thread, but it might not always be long enough.
std::this_thread::sleep_for(100ms); std::this_thread::sleep_for(100ms);
CallAfter([this]{ CallAfter([this]{
// This call is what probably makes the sleep unnecessary:
MacFinishLaunching();
if (!InitPart2()) if (!InitPart2())
exit(-1); exit(-1);
}); });