Hi everyone.

I was wondering...

Is there a dirrerence between doing this:

[pascal]
MyDirect3DInterface := nil;

//OR

MyDirect3dInterface.Release;
[/pascal]

and this:

[pascal]
if MyDirect3dInterface <> nil then MyDirect3dInterface.Release;

//OR

if MyDirect3dInterface <> nil then MyDirect3dInterface := nil;
[/pascal]

Until now, i usually set my interfaces to NIL to free them without the IF THEN check. However i often see this in other D3D sources (both pascal and C++).
So, Is there any difference between these methods.

I recall that i read somewere that releasing a method twice is bad:

[pascal]
MyDirect3dInterface.Release;
MyDirect3dInterface.Release;
[/pascal]

Is this also true when i do this??

[pascal]
MyDirect3dInterface := nil;
MyDirect3dInterface := nil;
[/pascal]

Can someone tell me what the right way is, because it's confusing me a bit.

Thanx alot