Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lennard Hofmann
RobotAPI
Commits
d684b359
Commit
d684b359
authored
6 years ago
by
Mirko Wächter
Browse files
Options
Downloads
Patches
Plain Diff
made NJointController cleanup exception safe
parent
91b8158c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointController.cpp
+18
-12
18 additions, 12 deletions
...ts/units/RobotUnit/NJointControllers/NJointController.cpp
with
18 additions
and
12 deletions
source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointController.cpp
+
18
−
12
View file @
d684b359
...
...
@@ -295,17 +295,22 @@ namespace armarx
NJointController
::~
NJointController
()
{
// make sure the destructor of the handles does not throw an exception and triggers a termination of the process
try
ARMARX_DEBUG
<<
"Deleting thread handles"
;
ScopedLock
lock
(
threadHandlesMutex
);
for
(
auto
&
pair
:
threadHandles
)
{
ARMARX_DEBUG
<<
"Deleting thread handles"
;
ScopedLock
lock
(
threadHandlesMutex
);
for
(
auto
&
pair
:
threadHandles
)
try
{
auto
&
name
=
pair
.
first
;
auto
&
handle
=
pair
.
second
;
if
(
!
handle
)
if
(
!
handle
||
!
handle
->
isValid
())
{
ARMARX_VERBOSE
<<
"Thread Handle is NULL or invalid - skipping"
;
continue
;
}
if
(
handle
->
isDetached
())
{
ARMARX_VERBOSE
<<
"Thread Handle is NULL - skipping"
;
continue
;
}
std
::
future_status
status
;
...
...
@@ -325,14 +330,15 @@ namespace armarx
}
while
(
status
!=
std
::
future_status
::
ready
);
}
catch
(...)
{
handleExceptions
();
}
}
threadHandles
.
clear
();
threadHandles
.
clear
();
}
catch
(...)
{
handleExceptions
();
}
}
ControlTargetBase
*
NJointController
::
useControlTarget
(
const
std
::
string
&
deviceName
,
const
std
::
string
&
controlMode
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment