D
Doug Haber
Hi All,
Everyone tells me that auto_ptr is a good idea, but auto_ptr and COM don't
play nice. Can someone please explain why auto_ptr and COM don't like each
other and what a reasonable/typical solution is? My guess is that auto_ptr
will call the destructor on the COM object which is bad because it should
call Release(). I'd like to avoid manually calling Release(), because my
function has a bunch of places from which it can return, which I think means
calling Release() from different places or doing some nasty GOTO.
Thanks!
Doug
Everyone tells me that auto_ptr is a good idea, but auto_ptr and COM don't
play nice. Can someone please explain why auto_ptr and COM don't like each
other and what a reasonable/typical solution is? My guess is that auto_ptr
will call the destructor on the COM object which is bad because it should
call Release(). I'd like to avoid manually calling Release(), because my
function has a bunch of places from which it can return, which I think means
calling Release() from different places or doing some nasty GOTO.
Thanks!
Doug