Dec 2, 2013 at 11:32 AM
Hi, I was wondering, in a Direct3D app using DirectXTK, I create a class that has ResourceViews and difeerent variables, but where and when does the destructor of the class being called? If not, where should I free the memory?
Dec 2, 2013 at 10:19 PM
Edited Dec 3, 2013 at 6:54 PM
With Direct3D C++ development a good solution for the COM object lifetimes is to use the Microsoft::WRL::ComPtr smart-pointer. We make use of this in DirectX TK's implementation. This causes the default destructor of the class to properly decrement the COM reference count.

See http://msdn.microsoft.com/en-us/library/windows/desktop/ms687260(v=vs.85).aspx
Marked as answer by walbourn on 12/23/2013 at 11:07 PM