Zitat von "H. Verbeet" hverbeet@gmail.com:
Nah, it's correct that the refcounts are broken at the moment. What Stefan probbly meant was that we might as well remove refcounting completely from that fucntion.
Then so should the AddRef/Release be removed from the StateBlock's Capture function as well.
If you set p.e. vertex declaration to 0, then you start recording, set vertex declaration to some object (ref still 1), then stop recording and get the stateblock, and then let this block Capture the device stateblock, the refcount of object would be decreased to 0 since the capturing stateblock's value of vertex declaration is &object, the device's is 0, and so stateblock would Release the object it holds.