
8 Mar
2009
8 Mar
'09
11:30 a.m.
Peter Dimov wrote:
There's also the option of using
struct com_deleter { template<class T> void operator()(T* p) const { p->Release(); } };
void test(IDirect3DDevice9 * const device) { boost::shared_ptr<IDirect3DDevice9> ptr( device, com_deleter() ); } Many thanks for this suggestion Peter. I've moved to using this sort of mechanism for now (and thus also dropped the #define BOOST_MEM_FN_ENABLE_STDCALL).
All the best, Conrad