diff options
Diffstat (limited to 'intern/ghost/intern/GHOST_NDOFManagerUnix.cpp')
-rw-r--r-- | intern/ghost/intern/GHOST_NDOFManagerUnix.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_NDOFManagerUnix.cpp b/intern/ghost/intern/GHOST_NDOFManagerUnix.cpp index 7e53ce45f70..7770f5f39ce 100644 --- a/intern/ghost/intern/GHOST_NDOFManagerUnix.cpp +++ b/intern/ghost/intern/GHOST_NDOFManagerUnix.cpp @@ -32,10 +32,11 @@ GHOST_NDOFManagerUnix::GHOST_NDOFManagerUnix(GHOST_System &sys) char line[MAX_LINE_LENGTH] = {0}; while (fgets(line, MAX_LINE_LENGTH, command_output)) { unsigned short vendor_id = 0, product_id = 0; - if (sscanf(line, "Bus %*d Device %*d: ID %hx:%hx", &vendor_id, &product_id) == 2) + if (sscanf(line, "Bus %*d Device %*d: ID %hx:%hx", &vendor_id, &product_id) == 2) { if (setDevice(vendor_id, product_id)) { break; /* stop looking once the first 3D mouse is found */ } + } } pclose(command_output); } @@ -44,8 +45,9 @@ GHOST_NDOFManagerUnix::GHOST_NDOFManagerUnix(GHOST_System &sys) GHOST_NDOFManagerUnix::~GHOST_NDOFManagerUnix() { - if (m_available) + if (m_available) { spnav_close(); + } } bool GHOST_NDOFManagerUnix::available() |