Original Post
I saw something that made me curious in the DirectX 8.1 SDK C++ help file. Under the help for the SetStreamSource() function I found this line:
"This method increments the reference count of the vertex buffer being assigned and decrements the reference count of the previously assigned vertex buffer. When the vertex buffer is no longer needed, set it to NULL. If you fail to do this, the vertex buffer is not released, resulting in a memory leak."
Now, here is what I''m not sure on. Lets say I have a pointer to a vertex buffer called pVB with a reference count of 1. If I say pVB->Release() then it deallocates and its gone. Does the quote I posted above mean that I can say *pVB = NULL without calling Release() and it would be gone or am I supposed to call Release, then set it to NULL?
This confused me. I just want to know the proper way to deallocate a buffer (or any DirectX object for that matter) in order to insure that it is definitely deallocated.
- Xizor -