[cairo] Huge leak in Cairo/win32

Tor Lillqvist tml at iki.fi
Thu Feb 24 14:18:55 PST 2005


Owen Taylor writes:
 > Where is your method documented? There is not a single place in
 > the SDK docs (other than in some of the examples) that I can find
 > that describes a need to save the initial bitmap and restore it.

Hmm, the SelectObject() "manpage" says in the Remarks section:

  This function returns the previously selected object of the
  specified type. An application should always replace a new object
  with the original, default object after it has finished drawing with
  the new object.

Which in typical Microsoft style vaguely says "after finished drawing"
instead of "before deleting", although the latter probably is what
they mean.

 > My assumption is that the 1x1 bitmap is somehow special and magic
 > and doesn't need to be destroyed. I wouldn't be surprised if it
 > is a singleton object.

I think so. Or maybe it's part of the DC structure. Feng Yuan's book
probably tells it in detail.

--tml





More information about the cairo mailing list