Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating an ImageTransport object inside a ROS node can lead to a circular dependency #311

Open
KmakD opened this issue May 17, 2024 · 0 comments

Comments

@KmakD
Copy link

KmakD commented May 17, 2024

Creating publishers, subscribers, etc., inside a ROS node implementation is a common practice. I did the same with an ImageTransport object, but this resulted in a circular dependency. When you pass a node (using shared_from_this()) to ImageTransport, it holds a reference to the ROS node, and this node holds a reference to the image transport object, thereby creating a circular dependency.

A common solution to avoid circular dependencies is to use weak pointers. What's your opinion on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant