I want to maintain an array of TADOConnection in Delphi.
I have a question related to this, but I think the fact it is TADOConnection instead of another component is irrelevant.
My application is divided in modules (each has its form)
The module creates its own TADOConnection (.Create method) but calls one single function, says FConnect to connect. The function FConnect remembers this connection by setting its .Tag to a integer value, and remembers it by putting it in a global array, says G:array[1..x] of TADOConnection, like this : G[N] := PassedADOConnectionObject;
When the entire Application terminates, it calls another function says FDisconnect that should nicely close all the connections that were remembered.
My question is this : some modules have already freed (Free method) "their" connection.
How can the centralised FDisconnect "detect" it has not to close some because they have already been freed ?