From 790db8faab093231664c402fcc33b0b96687e222 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 24 Dec 2022 23:08:08 +0100 Subject: [PATCH] Fix crash when starting two batch converters at the same time. --- src/tools/dcpomatic_batch.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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)); -- 2.30.2