I'm curious because I couldn't find out about this on MSDN. I've found the Release()
function is present in various COM objects which I'm obviously supposed to use for deleting pointers. But I'm not sure what does it return exactly? I used to think it would return the number of references which still exist to the object remaining, therefore something like:
while( pointer->Release() > 0 );
Would obviously release all references to that pointer?
Or am I not seeing something?
*note I'm talking about this from the concept of the IDirect3DTexture9::Release()
function
In addition to what Mehrdad said, the return value of Release is intended for debugging purposes only. Production code should just ignore it.
Looping until Release() returns 0 is definitely a bug - you should never release references you don't own.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With