Deeper understanding of VTK exporter’s SetStartWriteArgDelete

I am considering writing a custom exporter and was hoping to better understand the method SetStartWriteArgDelete()

Where can I find more design rationale information about the method?

Cheers

vtkExporter just do:

  if (this->StartWrite)
  {
    (*this->StartWrite)(this->StartWriteArg);
  }
  this->WriteData();
  if (this->EndWrite)
  {
    (*this->EndWrite)(this->EndWriteArg);
  }

But then someone realized the these method could allocate data and then leaks so they added the “Delete” version that are called in the destructor:

  if ((this->StartWriteArg) && (this->StartWriteArgDelete))
  {
    (*this->StartWriteArgDelete)(this->StartWriteArg);
  }
  if ((this->EndWriteArg) && (this->EndWriteArgDelete))
  {
    (*this->EndWriteArgDelete)(this->EndWriteArg);
  }

This is completely unused in VTK and since this was added in 1998, should be deprecated and removed imo, unless you see a usecase where it matters.