Prevent 'bad weak_ptr exception' when copying return from getRobotNameHelper()
The RobotNameHelper uses shared_from_this, which
makes copying the class very dangerous. E.g. an 'auto
rnh = getRobotNameHelper();' inevitably lead to this
error as the the rnh was copied (returned const ref
and auto drops const refs --> the type of rnh was
RobotNameHelper). To prevent this happening to
unknowing users, it now returns a shared_ptr:
Signed-off-by:
robdekon_h2t <robdekon@kit.edu>
parent
c1dcc213
No related branches found
No related tags found
Showing
- source/RobotAPI/libraries/GraspingUtility/box_to_grasp_candidates.cpp 2 additions, 2 deletions...API/libraries/GraspingUtility/box_to_grasp_candidates.cpp
- source/RobotAPI/libraries/GraspingUtility/box_to_grasp_candidates.h 1 addition, 1 deletion...otAPI/libraries/GraspingUtility/box_to_grasp_candidates.h
- source/RobotAPI/libraries/GraspingUtility/grasp_candidate_drawer.cpp 4 additions, 2 deletions...tAPI/libraries/GraspingUtility/grasp_candidate_drawer.cpp
- source/RobotAPI/libraries/GraspingUtility/grasp_candidate_drawer.h 1 addition, 1 deletion...botAPI/libraries/GraspingUtility/grasp_candidate_drawer.h
- source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotStateComponentPlugin.cpp 3 additions, 3 deletions...es/RobotAPIComponentPlugins/RobotStateComponentPlugin.cpp
- source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotStateComponentPlugin.h 2 additions, 2 deletions...ries/RobotAPIComponentPlugins/RobotStateComponentPlugin.h
Loading
Please register or sign in to comment