Archived

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

How many times call Release() for DirectDraw Clipper?

This topic is 5751 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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