Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
d5d238e5
Commit
d5d238e5
authored
8 years ago
by
Jacob Walser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always stopPolling joystick before stopping thread
parent
501c0fe3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
JoystickManager.cc
src/Joystick/JoystickManager.cc
+6
-4
No files found.
src/Joystick/JoystickManager.cc
View file @
d5d238e5
...
@@ -84,16 +84,18 @@ void JoystickManager::_setActiveJoystickFromSettings(void)
...
@@ -84,16 +84,18 @@ void JoystickManager::_setActiveJoystickFromSettings(void)
*/
*/
#endif
#endif
if
(
_activeJoystick
&&
!
newMap
.
contains
(
_activeJoystick
->
name
()))
{
qCDebug
(
JoystickManagerLog
)
<<
"Active joystick removed"
;
setActiveJoystick
(
NULL
);
}
// Check to see if our current mapping contains any joysticks that are not in the new mapping
// Check to see if our current mapping contains any joysticks that are not in the new mapping
// If so, those joysticks have been unplugged, and need to be cleaned up
// If so, those joysticks have been unplugged, and need to be cleaned up
QMap
<
QString
,
Joystick
*>::
iterator
i
;
QMap
<
QString
,
Joystick
*>::
iterator
i
;
for
(
i
=
_name2JoystickMap
.
begin
();
i
!=
_name2JoystickMap
.
end
();
++
i
)
{
for
(
i
=
_name2JoystickMap
.
begin
();
i
!=
_name2JoystickMap
.
end
();
++
i
)
{
if
(
!
newMap
.
contains
(
i
.
key
()))
{
if
(
!
newMap
.
contains
(
i
.
key
()))
{
qCDebug
(
JoystickManagerLog
)
<<
"Releasing joystick:"
<<
i
.
key
();
qCDebug
(
JoystickManagerLog
)
<<
"Releasing joystick:"
<<
i
.
key
();
if
(
_activeJoystick
&&
!
newMap
.
contains
(
_activeJoystick
->
name
()))
{
i
.
value
()
->
stopPolling
();
qCDebug
(
JoystickManagerLog
)
<<
"
\t
was active"
;
setActiveJoystick
(
NULL
);
}
i
.
value
()
->
wait
(
1000
);
i
.
value
()
->
wait
(
1000
);
i
.
value
()
->
deleteLater
();
i
.
value
()
->
deleteLater
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment