From: Carl Hetherington Date: Sat, 24 Dec 2022 22:08:08 +0000 (+0100) Subject: Fix crash when starting two batch converters at the same time. X-Git-Tag: v2.16.38~12 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=790db8faab093231664c402fcc33b0b96687e222;p=dcpomatic.git Fix crash when starting two batch converters at the same time. --- diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc index dcda39fd8..6e054edf8 100644 --- a/src/tools/dcpomatic_batch.cc +++ b/src/tools/dcpomatic_batch.cc @@ -442,8 +442,12 @@ class App : public wxApp } _frame->Show (); - auto server = new JobServer (_frame); - new thread (boost::bind (&JobServer::run, server)); + try { + auto server = new JobServer (_frame); + new thread (boost::bind (&JobServer::run, server)); + } catch (boost::system::system_error& e) { + error_dialog(_frame, _("Could not listen for new batch jobs. Perhaps another instance of the DCP-o-matic Batch Converter is running.")); + } signal_manager = new wxSignalManager (this); this->Bind (wxEVT_IDLE, boost::bind (&App::idle, this));