From 6eee0c043ce330a146516dd8373d5d529f3660bd Mon Sep 17 00:00:00 2001 From: David Kocik Date: Wed, 14 Oct 2020 18:17:31 +0200 Subject: [PATCH] order of checking lockfile in instance check --- src/slic3r/GUI/InstanceCheck.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/InstanceCheck.cpp b/src/slic3r/GUI/InstanceCheck.cpp index 31115c6aa..77d35a3e1 100644 --- a/src/slic3r/GUI/InstanceCheck.cpp +++ b/src/slic3r/GUI/InstanceCheck.cpp @@ -254,7 +254,8 @@ bool instance_check(int argc, char** argv, bool app_config_single_instance) GUI::wxGetApp().init_single_instance_checker(lock_name + ".lock", data_dir() + "/cache/"); if (cla.should_send.value() && GUI::wxGetApp().single_instance_checker()->IsAnotherRunning()) { #else // mac & linx - if (*cla.should_send && instance_check_internal::get_lock(lock_name + ".lock", data_dir() + "/cache/")) { + // get_lock() creates the lockfile therefore *cla.should_send is checked after + if (instance_check_internal::get_lock(lock_name + ".lock", data_dir() + "/cache/"&& *cla.should_send)) { #endif instance_check_internal::send_message(cla.cl_string, lock_name); BOOST_LOG_TRIVIAL(info) << "instance check: Another instance found. This instance will terminate.";