Does the same thing the destructor
~Path()
does: Callsdelete()
on the pointers toPoints
onpoints
, clearspoints
andconnectors
, deletesdraw_color
andfill_color
, if they point toColors
that were allocated on the free store, and sets them to 0.
clear()
is a pure virtual function inclass Shape
, soPath
must be have aclear()
function. It is needed, because it is sometimes called through a pointer toShape
, so that~Path()
cannot be accessed. At least, so far I haven't found a way to call a destructor through the virtual function facility.