Archived

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

romer

How many times call Release() for DirectDraw Clipper?

Recommended Posts

In TOTWGPG under the section when he talks about clipping a windowed direct draw program (chapter 7, near the very end, pg 400 or so), you have to call lpddclipper->Release(); two times, 1 for the creation of the clipper and a second time for the call to SetClipper();. Is this true for only windowed direct draw programs or is it also true for fullscreen direct draw programs?

Share this post


Link to post
Share on other sites
It will be true for any time you call the "SetClipper" function regardless of the mode. Apparently, SetClipper() calls AddRef() for your clipper (either directly or indirectly through a call such as QueryInterface). Every AddRef() needs a corresponding Release() in COM in order to prevent leaks.

Share this post


Link to post
Share on other sites