chronozphere
06-08-2007, 08:36 PM
Hi everyone. :)
I was wondering...
Is there a dirrerence between doing this:
MyDirect3DInterface := nil;
//OR
MyDirect3dInterface.Release;
and this:
if MyDirect3dInterface <> nil then MyDirect3dInterface.Release;
//OR
if MyDirect3dInterface <> nil then MyDirect3dInterface := nil;
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:
MyDirect3dInterface.Release;
MyDirect3dInterface.Release;
Is this also true when i do this??
MyDirect3dInterface := nil;
MyDirect3dInterface := nil;
Can someone tell me what the right way is, because it's confusing me a bit.
Thanx alot ;)
I was wondering...
Is there a dirrerence between doing this:
MyDirect3DInterface := nil;
//OR
MyDirect3dInterface.Release;
and this:
if MyDirect3dInterface <> nil then MyDirect3dInterface.Release;
//OR
if MyDirect3dInterface <> nil then MyDirect3dInterface := nil;
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:
MyDirect3dInterface.Release;
MyDirect3dInterface.Release;
Is this also true when i do this??
MyDirect3dInterface := nil;
MyDirect3dInterface := nil;
Can someone tell me what the right way is, because it's confusing me a bit.
Thanx alot ;)