From 8c882ca9311e70fc0a1577a5c38baba16e4398b2 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 14 Jun 2016 11:44:01 +0200 Subject: proto/freetrack: less noise if registry clearing disabled --- proto-ft/mutex.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'proto-ft') diff --git a/proto-ft/mutex.cpp b/proto-ft/mutex.cpp index 63cf4334..073c6f08 100644 --- a/proto-ft/mutex.cpp +++ b/proto-ft/mutex.cpp @@ -15,19 +15,18 @@ bool check_for_first_run::is_first_run() void check_for_first_run::set_enabled(bool flag) { enabled = flag; - qDebug() << "ft runonce:" << "enabled" << flag; } void check_for_first_run::try_runonce() { constexpr const char* name = "opentrack-freetrack-runonce"; - + if (checked_for_first_run) return; - + // just leak it, no issue HANDLE h = CreateMutexA(nullptr, false, name); - + switch (WaitForSingleObject(h, 0)) { case WAIT_OBJECT_0: @@ -41,11 +40,9 @@ void check_for_first_run::try_runonce() checked_for_first_run = false; break; } - + if (checked_for_first_run && !is_first_instance) CloseHandle(h); - - qDebug() << "ft runonce:" << "enabled" << enabled << "first-run" << is_first_instance << "checked" << checked_for_first_run; } check_for_first_run::~check_for_first_run() @@ -55,7 +52,6 @@ check_for_first_run::~check_for_first_run() void check_for_first_run::try_exit() { - qDebug() << "ft runonce enabled:" << enabled; if (is_first_instance && enabled) { qDebug() << "ft runonce: removing registry keys"; -- cgit v1.2.3