Free vs Delete

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
palatini
Posts: 2
Joined: Thu 26 Dec 2019 02:07

Free vs Delete

Post by palatini » Thu 27 Jan 2022 02:38

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;

palatini
Posts: 2
Joined: Thu 26 Dec 2019 02:07

Re: Free vs Delete

Post by palatini » Wed 02 Feb 2022 00:40

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.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Free vs Delete

Post by MaximG » Wed 02 Feb 2022 19:49

Please feel free to contact us if you have any questions

Post Reply