summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerjoystick.cpp
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2020-08-18 20:24:25 +0000
committerDave Houlton <euclid@lindenlab.com>2020-08-18 20:24:25 +0000
commit60eaa353a9e6acd9bec032cd408c570c28024e09 (patch)
tree123671904c3b349b3f557483a4a98781ce03943a /indra/newview/llviewerjoystick.cpp
parent2c964e82f5ac42fbb86f551783dfb04fcdfaf460 (diff)
parent9f0da75332fcbb1bc97812baf67900702d6ced85 (diff)
Merged in DV497-merge-6.4.8 (pull request #244)
Merge master 6.4.8 into DRTVWR-497
Diffstat (limited to 'indra/newview/llviewerjoystick.cpp')
-rw-r--r--indra/newview/llviewerjoystick.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp
index 3d06c95080..491ad7e3b2 100644
--- a/indra/newview/llviewerjoystick.cpp
+++ b/indra/newview/llviewerjoystick.cpp
@@ -309,10 +309,13 @@ void LLViewerJoystick::init(bool autoenable)
void LLViewerJoystick::terminate()
{
#if LIB_NDOF
-
- ndof_libcleanup();
- LL_INFOS("joystick") << "Terminated connection with NDOF device." << LL_ENDL;
- mDriverState = JDS_UNINITIALIZED;
+ if (mNdofDev != NULL)
+ {
+ ndof_libcleanup(); // frees alocated memory in mNdofDev
+ mDriverState = JDS_UNINITIALIZED;
+ mNdofDev = NULL;
+ LL_INFOS("joystick") << "Terminated connection with NDOF device." << LL_ENDL;
+ }
#endif
}