1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 08:38:39 +02:00

Fix Audacity failing silently on new instance

Should now behave the same on Linux as on Windows.
This commit is contained in:
Steve Daulton 2018-04-29 21:03:13 +01:00
parent 0248c870b2
commit 837d5e18f3

View File

@ -1902,6 +1902,8 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
// Connect to the existing Audacity
sock->Connect(addr, true);
if (sock->IsConnected())
{
if (parser->GetParamCount() > 0)
{
for (size_t i = 0, cnt = parser->GetParamCount(); i < cnt; i++)
{
@ -1909,8 +1911,14 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
wxString param = parser->GetParam(i);
sock->WriteMsg((const wxChar *) param, (param.Len() + 1) * sizeof(wxChar));
}
}
else
{
// Send an empty string to force existing Audacity to front
sock->WriteMsg(wxEmptyString, sizeof(wxChar));
}
return false;
return sock->Error();
}
wxMilliSleep(100);