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:
|
DynamixelWorkbench *dxl_wb_; |
|
dxl_wb_ = new DynamixelWorkbench; |
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
Currently, when we kill
dynamixel_workbench_controllerswith 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:
dynamixel-workbench/dynamixel_workbench_toolbox/src/dynamixel_workbench_toolbox/dynamixel_driver.cpp
Lines 29 to 37 in 67a1631
But this destructor is not called because
dxl_wb_(pointer to instance ofDynamixelWorkbench(child class ofDynamixelDriver)) is a bare pointer:dynamixel-workbench/dynamixel_workbench_controllers/include/dynamixel_workbench_controllers/dynamixel_workbench_controllers.h
Line 75 in 67a1631
dynamixel-workbench/dynamixel_workbench_controllers/src/dynamixel_workbench_controllers.cpp
Line 45 in 67a1631
and current code does not call
deleteagainst 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