Re: Is this correct? (TADOConnection)



Frederico,

if you take a look at FConnectionObject's declaration, you'l see that it is a "pointer" to an interface (ADOInt._Connection) that descends from IInterface, and as such it is reference counted. So, when you assign nil to this pointer, the underlying object is freed. So, yes, the command is correct.

Bill Dekleris

Quasar Software.

--
-----------------------------------------------------------------------------------------


http://www.infosnap.eu

Home page of InfoSnap - the powerful, all-purpose information and knowledge-base manager.

-----------------------------------------------------------------------------------------



Frederico Pissarra wrote:
Hello!!!

Taking a look at ADODB unit in $(DELPHI)\Source\VCL (I'm using D7 here), you can see the following code:

-------------%<------------cut here -------------%<------------------------
destructor TADOConnection.Destroy;
...
FConnectionObject := nil;
...
end;

-------------%<------------cut here -------------%<------------------------

Notice that FConnectionObject is not released (calling IUnknown.Release), but the reference simply will point to nil.

Is this correct?

[]s
Fred


.



Relevant Pages