Skip to content

Memory leak when exitting dynamixel_workbench_controllers #388

Description

@pazeshun

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions