diff options
Diffstat (limited to 'proto-ft')
-rwxr-xr-x | proto-ft/ftnoir_ftcontrols.ui | 6 | ||||
-rwxr-xr-x | proto-ft/ftnoir_protocol_ft.cpp | 1 | ||||
-rwxr-xr-x | proto-ft/ftnoir_protocol_ft.h | 1 | ||||
-rwxr-xr-x | proto-ft/mutex.cpp | 29 |
4 files changed, 17 insertions, 20 deletions
diff --git a/proto-ft/ftnoir_ftcontrols.ui b/proto-ft/ftnoir_ftcontrols.ui index b63d92a1..10c2c427 100755 --- a/proto-ft/ftnoir_ftcontrols.ui +++ b/proto-ft/ftnoir_ftcontrols.ui @@ -12,8 +12,8 @@ <rect> <x>0</x> <y>0</y> - <width>511</width> - <height>413</height> + <width>503</width> + <height>379</height> </rect> </property> <property name="sizePolicy"> @@ -212,7 +212,7 @@ Starting tracking will again overwrite the DLL locations.</string> </sizepolicy> </property> <property name="text"> - <string>Disable on protocol exit</string> + <string>Disable on program exit</string> </property> </widget> </item> diff --git a/proto-ft/ftnoir_protocol_ft.cpp b/proto-ft/ftnoir_protocol_ft.cpp index 121da494..42671b8f 100755 --- a/proto-ft/ftnoir_protocol_ft.cpp +++ b/proto-ft/ftnoir_protocol_ft.cpp @@ -32,7 +32,6 @@ FTNoIR_Protocol::~FTNoIR_Protocol() dummyTrackIR.terminate(); dummyTrackIR.kill(); dummyTrackIR.waitForFinished(50); - runonce_check->try_exit(); } void FTNoIR_Protocol::pose(const double* headpose) { diff --git a/proto-ft/ftnoir_protocol_ft.h b/proto-ft/ftnoir_protocol_ft.h index b5b802bd..061504d9 100755 --- a/proto-ft/ftnoir_protocol_ft.h +++ b/proto-ft/ftnoir_protocol_ft.h @@ -43,7 +43,6 @@ typedef void (__stdcall *importTIRViewsStop)(void); struct runonce { virtual void try_runonce() = 0; - virtual void try_exit() = 0; virtual bool is_first_run() = 0; virtual ~runonce() {} virtual void set_enabled(bool flag) = 0; diff --git a/proto-ft/mutex.cpp b/proto-ft/mutex.cpp index 34f5f518..88021810 100755 --- a/proto-ft/mutex.cpp +++ b/proto-ft/mutex.cpp @@ -7,7 +7,20 @@ class check_for_first_run : public runonce bool is_first_instance; bool enabled; + void try_exit() + { + if (is_first_instance && enabled) + { + qDebug() << "ft runonce: removing registry keys"; + FTNoIR_Protocol::set_protocols(false, false); + } + } + public: + check_for_first_run() : checked_for_first_run(false), is_first_instance(false), enabled(false) + { + } + bool is_first_run() override { return checked_for_first_run && is_first_instance; @@ -23,7 +36,7 @@ public: { constexpr const char* name = "opentrack-freetrack-runonce"; - if (checked_for_first_run || !enabled) + if (checked_for_first_run) return; // just leak it, no issue @@ -49,20 +62,6 @@ public: qDebug() << "ft runonce:" << "first-run" << is_first_instance << "checked" << checked_for_first_run; } - void try_exit() override - { - if (is_first_instance && enabled) - { - qDebug() << "ft runonce: removing registry keys"; - FTNoIR_Protocol::set_protocols(false, false); - } - } - -public: - check_for_first_run() : checked_for_first_run(false), is_first_instance(false), enabled(false) - { - } - ~check_for_first_run() { try_exit(); |