Advertisement

How many times call Release() for DirectDraw Clipper?

Started by March 19, 2002 10:14 PM
0 comments, last by romer 22 years, 7 months ago
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?
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.

This topic is closed to new replies.

Advertisement