Page 1 of 1

Free vs Delete

Posted: Thu 27 Jan 2022 02:38
by palatini
on the demos we have example code

{
TMyQuery* q = new TMyQuery(NULL);
try
{
...
}
__finally
{
q->Free();
}
}

TMyConnection* MyConnection1 = new TMyConnection(NULL);
try {
....
}
__finally {
MyConnection1->Free();
}


I would like to know why the examples use q->Free(); instead of delete q;

Re: Free vs Delete

Posted: Wed 02 Feb 2022 00:40
by palatini
Emailed the above question to support and got this response.

According to the Embarcadero documentation, the Delete method is recommended to be used in the C++ projects.

Re: Free vs Delete

Posted: Wed 02 Feb 2022 19:49
by MaximG
Please feel free to contact us if you have any questions