Skip to content
Snippets Groups Projects
Commit e8d9272e authored by Christoph Pohl's avatar Christoph Pohl Committed by robdekon_h2t
Browse files

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: default avatarrobdekon_h2t <robdekon@kit.edu>
parent c1dcc213
No related branches found
No related tags found
1 merge request!284Prevent 'bad weak_ptr exception' when copying return from getRobotNameHelper()
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment