0

I've got an ID3DXFont (which is Direct3D9, by the way) which offers a method GetDC() which returns a handle to a device context (hDC). How is the memory for this value managed? MSDN doesn't mention anything about it and it doesn't provide it's own memory management like COM interfaces do.

Motti
  • 110,860
  • 49
  • 189
  • 262
Puppy
  • 144,682
  • 38
  • 256
  • 465

3 Answers3

1

You need to release that handle with ReleaseDC(HDC).

ltjax
  • 15,837
  • 3
  • 39
  • 62
0

Can't you use SAFE_RELEASE macro on the handle?

Karlth
  • 3,267
  • 2
  • 27
  • 28
0

I believe you have to call DeleteDC on the handle returned, when you are done with it. It was difficult to find much reference to this, with the exception of a comment made in this thread on gamedev.net.

Moo-Juice
  • 38,257
  • 10
  • 78
  • 128