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

Improve warning message when unloading a library still in use. #118

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from

Conversation

nuclearsandwich
Copy link
Member

Port #108 to ROS 2. PR open for CI.

- include library name
- nicer formatting
@nuclearsandwich nuclearsandwich changed the title Improve warning message when unloading a library still in the heap. Improve warning message when unloading a library still in use. Jan 30, 2019
@hidmic
Copy link

hidmic commented Sep 10, 2021

@nuclearsandwich shall we close this?

Comment on lines +153 to +157
CONSOLE_BRIDGE_logWarn("class_loader.ClassLoader: SEVERE WARNING!!!\n"
"Attempting to unload %s\n"
"while objects created by this library still exist in the heap!\n"
"You should delete your objects before destroying the ClassLoader. "
"The library will NOT be unloaded.", library_path_.c_str());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In most cases is this a side-affect of the ClassLoader object going out of scope and being destroyed while the plugin(s) it has loaded are still in scope?

Would it be helpful to add this to the error message?

Please verify that the lifetime of the ClassLoader for {} is at least as long as the lifetime of all plugins loaded by that ClassLoader.

@audrow audrow changed the base branch from ros2 to rolling June 28, 2022 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants