thiago
User
 Fresh Boarder
| Posts: 8 |   | Karma: 0 |
|
TADParam leaks with param DataType ftUnknown
|
|
Posted: 2007/06/14 08:33 |
|
|
|
|
Hello AnyDAC team,
I have some problems with memory leaks in AnyDAC. For each parameter with DataType "ftUnknown" that I create for an ADQuery or that gets created automatically when assigning a SQL statement and opening the query, there's a memory leak of a TADParam and the TADParams list.
I traced the problem down to the file daADCompClient where in line 3351 the call to "Prepare" ends up in an exception if there's a parameter with DataType "ftUnknown". After this exception is raised the rest of the procedure "InternalPrepare" is not executed which causes one TADParam to leak because the parameter is copied into another object and the old one is left alone.
I solved the problem by just putting a try...finally..end block starting from line 3341 and ending in line 3362 (see attached file daADCompClient.pas). But I am not sure if this is a good idea. Could you please check this and tell me how to fix the problem in a different way if this solution is not the best one.
Thank you in advance!
Timo
Post edited by: thiago, at: 2007/06/14 08:35
|
|