diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2016-06-14 11:44:01 +0200 | 
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-06-14 18:14:46 +0200 | 
| commit | 8c882ca9311e70fc0a1577a5c38baba16e4398b2 (patch) | |
| tree | 3e944dc8895212a1269cdd0c85b04ba3eb9fb48e /proto-ft | |
| parent | 21245bb4d55cc0acbb2556e6fe3bac18bd5d55ec (diff) | |
proto/freetrack: less noise if registry clearing disabled
Diffstat (limited to 'proto-ft')
| -rw-r--r-- | proto-ft/mutex.cpp | 12 | 
1 files changed, 4 insertions, 8 deletions
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";  | 
