Closed pattacini closed 10 years ago
actionL and actionR pointers set to NULL after deletion of the pointed objects.
Nope...
Pushed now.
The problem is not the one you mentioned. I was referring to something else.
Hint: what happens to the action class handling the left arm if the one for the right arm fails to start?
My 2 cents: Both should be deleted and the module should stop and quit if either of the two actions is not instantiated correctly. I think I'll do something like the following:
cout<<"***** Instantiating primitives for left hand"<<endl;
actionL = new AFFACTIONPRIMITIVESLAYER(optionL);
cout<<"***** Instantiating primitives for right hand"<<endl;
actionR=new AFFACTIONPRIMITIVESLAYER(optionR);
if (!actionR->isValid() || !actionL->isValid() )
{
delete actionR;
actionR = NULL;
delete actionL;
actionL = NULL;
return false;
}
By the way, I was thinking about the following:
virtual bool getGraspModel(perception::Model *&model) const;
Especially on *Model &**, a reference to a pointer to a Model. I have to think about how it works.
:+1:
Something is left unhandled if you reach this line...