Free vs Delete
Posted: 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;
{
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;