This is with Delphi XE2 and FastMM 4.99, and a 32-bit program on a Win7-64 machine.
I was trying to use FastMM to check a smallish program I've been working on. The program includes a data module that is on the project's auto-created forms list. The data module contains only a TADOConnection object.
When I enable FullDebugMode in FastMM, I get an invalid typecast error when exiting the program. The culprit seems to be in freeing the datamodule (the error occurs in TADOConnection.GetADODataSet
). Can anyone suggest why this is happening?
It turns out that the problem was just something that was exposed by FastMM, not caused by it.
Specifically, I'd subclassed TADOQuery
for use with the data module. I remembered to write a destructor override for the class, but failed to call the inherited dtor. Probably this was causing the TADOConnection
to do something undefined.