Archived

This topic is now archived and is closed to further replies.

aker_jus

Smart pointers

Recommended Posts

I was recently looking at CComPtr of atlbase.h and I was wondering if it would be a good choice to use Smart pointers instead of the ordinary way LPDIRECT3DDEVICE9 for instance. I will not have to call Release, is that right? Any other benefits I get from smart pointers? Thanks

Share this post


Link to post
Share on other sites
Yes,do not need call release any more,because CComPtr call it on destruct.

More benefits on QIs.

We create world.

Share this post


Link to post
Share on other sites
QIs? Can you tell me some more on that?

Also, if I create the device first and then the texture for example, how do I make sure that the texture is released before the device? Or does it handle it automatically?

Share this post


Link to post
Share on other sites