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
5ddd7d6a
Commit
5ddd7d6a
authored
Aug 26, 2015
by
Nate Weibley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix thread unsafe simulator shutdown. Use a signal/slot connection to execute on correct thread
parent
c4f83d17
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
QGCFlightGearLink.cc
src/comm/QGCFlightGearLink.cc
+3
-2
QGCHilLink.h
src/comm/QGCHilLink.h
+5
-0
UAS.cc
src/uas/UAS.cc
+1
-1
No files found.
src/comm/QGCFlightGearLink.cc
View file @
5ddd7d6a
...
...
@@ -70,6 +70,7 @@ QGCFlightGearLink::QGCFlightGearLink(UASInterface* mav, QString startupArguments
// We need a mechanism so show error message from our FGLink thread on the UI thread. This signal connection will do that for us.
connect
(
this
,
&
QGCFlightGearLink
::
showCriticalMessageFromThread
,
qgcApp
(),
&
QGCApplication
::
criticalMessageBoxOnMainThread
);
connect
(
this
,
&
QGCFlightGearLink
::
disconnectSim
,
this
,
&
QGCFlightGearLink
::
disconnectSimulation
);
}
QGCFlightGearLink
::~
QGCFlightGearLink
()
...
...
@@ -496,13 +497,13 @@ bool QGCFlightGearLink::disconnectSimulation()
if
(
_fgProcess
)
{
_fgProcess
->
close
();
delete
_fgProcess
;
_fgProcess
->
deleteLater
()
;
_fgProcess
=
NULL
;
}
if
(
_udpCommSocket
)
{
_udpCommSocket
->
close
();
delete
_udpCommSocket
;
_udpCommSocket
->
deleteLater
()
;
_udpCommSocket
=
NULL
;
}
...
...
src/comm/QGCHilLink.h
View file @
5ddd7d6a
...
...
@@ -83,6 +83,11 @@ signals:
**/
void
simulationDisconnected
();
/**
* @brief Thread safe signal to disconnect simulator from other threads
**/
void
disconnectSim
();
/**
* @brief This signal is emitted instantly when the link status changes
**/
...
...
src/uas/UAS.cc
View file @
5ddd7d6a
...
...
@@ -3227,7 +3227,7 @@ void UAS::startHil()
void
UAS
::
stopHil
()
{
if
(
simulation
&&
simulation
->
isConnected
())
{
simulation
->
disconnectSim
ulation
();
simulation
->
disconnectSim
();
setMode
(
base_mode
&
~
MAV_MODE_FLAG_HIL_ENABLED
,
custom_mode
);
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"HIL is onboard not enabled, trying to disable."
;
}
...
...
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