Or use a smart pointer built for COM such as CComPtr.The COM stuff has reference counting but it's not automatic. You can use a custom deleter with a smart pointer to manage DX objects automatically.
D3DX Memory leaks
I was only sugesting those macros because that's exactly what's the op doing in is code exept without macro, and would have saved him about a hundred lines of code, but i don't see him gettings downrated for no good reason. I didn't put a gun on his head and said you MUST use them, i only sugessted them to reduce is code size.
But go ahead, continue to downrate me for no reason, and for trying to help, because it was the last time i spend time here helping someone, im getting tired of those "chest beating" game for stupidity like that, and had a very bad day on top of that.
Thank you.
Hello,
I guess about 99% of the leaks are gone now. But when I turned on the DirectX debug runtime, the number of leaks did explode again. Do I have to bother with those leaks because they don't happen when I use the retail runtime?
Thanks
Jack
It's good practise that you do remove them. Retail doesn't show them because it doesn't check for them.
Do I have to bother with those leaks because they don't happen when I use the retail runtime?
They do happen when you use runtime, they just won't be shown to you. Think about like how release mode compiling won't correctly let you step through your code - just as for directx, it won't be able to detect memory leaks properly when in release mode.
Or use a smart pointer built for COM such as CComPtr.The COM stuff has reference counting but it's not automatic. You can use a custom deleter with a smart pointer to manage DX objects automatically.
*googlygooglygoogly*
No MFC, no ATL...
_com_ptr_t
OMG, that could have been so useful when I was messing with COM.