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

Memory leak when exitting dynamixel_workbench_controllers #388

Open
pazeshun opened this issue Nov 27, 2024 · 0 comments
Open

Memory leak when exitting dynamixel_workbench_controllers #388

pazeshun opened this issue Nov 27, 2024 · 0 comments

Comments

@pazeshun
Copy link

pazeshun commented Nov 27, 2024

Currently, when we kill dynamixel_workbench_controllers with Ctrl-C, the motors are left torque on.
However, I think this is due to a bug of dynamixel_workbench_controllers.

Expected behavior is making the motors torque off:

DynamixelDriver::~DynamixelDriver()
{
for (int i = 0; i < tools_cnt_; i++)
{
for (int j = 0; j < tools_[i].getDynamixelCount(); j++)
{
writeRegister(tools_[i].getID()[j], "Torque_Enable", (uint8_t)0);
}
}

But this destructor is not called because dxl_wb_ (pointer to instance of DynamixelWorkbench (child class of DynamixelDriver)) is a bare pointer:


and current code does not call delete against that pointer.
This causes a memory leak.

Although this seems a bug, many people probably depends on the current behavior and that memory leak is not fatal to the PC.
So I just leave this issue without fixing it.

Related to #386

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