to handlers which might want to assign it to a SGPropertyNode_ptr for
reference counting (Nasal does, for instance, to prevent garbage
collector interactions). If that smart pointer is then destroyed,
that will free this object while it is still live.
Simply use a SGPropertyNode_ptr here; the code ends up smaller as a
bonus, since FGBinding no longer has to deallocation for _arg.
read(node);
}
-FGBinding::~FGBinding ()
-{
- delete _arg; // Delete the saved arguments
-}
-
void
FGBinding::read (const SGPropertyNode * node)
{
return;
}
- delete _arg;
_arg = new SGPropertyNode;
_setting = 0;
copyProperties(node, _arg); // FIXME: don't use whole node!!!
/**
* Destructor.
*/
- virtual ~FGBinding ();
+ virtual ~FGBinding () {}
/**
string _command_name;
mutable SGCommandMgr::command_t _command;
- mutable SGPropertyNode * _arg;
+ mutable SGPropertyNode_ptr _arg;
mutable SGPropertyNode_ptr _setting;
};