Skip to content
Snippets Groups Projects
Commit 033102d8 authored by Sam Horvath's avatar Sam Horvath
Browse files

BUG: Old errors cause new HDAPI devices to appear to fail

The HDAPI error stack persists across device instances, so the error
stack should be flushed before initializing a new device and checking
for initialization errors.  Otherwise, a fatal error is thrown even if
the device intializes correctly
parent a4cac529
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,10 @@ HDAPIDeviceClient::init()
{
m_buttons = std::map < size_t, bool > { { 0, false }, { 1, false }, { 2, false }, { 3, false }};
//flush error stack
HDErrorInfo errorFlush;
while (HD_DEVICE_ERROR(errorFlush = hdGetError())){}
// Open Device
m_handle = hdInitDevice(this->getDeviceName().c_str());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment