econsystems / taraxl-isaac-package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

memory leak: the TaraXLPoseTracking object is not deleted

nvidiamfilimonov opened this issue · comments

The TaraXLPoseTracking object allocated at

taraxlPoseTracking = new TaraXLPoseTracking(selectedCam);

is not deleted, thus it's memory is leaked.
I suggest using std::unique_ptr smart pointer and std::make_unique function to avoid the leak.

Hi @nvidiamfilimonov ,

The mentioned suggestion is done in the latest commit. Please consider the changes.

Thank you.

Thank you, I suggest also explicitly deleting the TaraXLPoseTracking object by calling unique_ptr::reset in TaraXLIMU::stop()
It's allocated at start and not needed after stop.

Done in the commit here.

The code can be simplified to taraxlPoseTracking.reset();