[cairo] Huge leak in Cairo/win32

Owen Taylor otaylor at redhat.com
Thu Feb 24 10:08:09 PST 2005


On Sun, 2005-02-20 at 21:46 -0500, Owen Taylor wrote:
> Hans Breuer wrote:
> > While playing with gtk/win32's Cairo integration I spotted
> > a huge leak also visible with cairo_snippets_win32. To see
> > it simply go through the snippets with key 'n' or 'p' and
> > watch the memory usage with the task manager.
> > 
> > To plug it apply the attached patch :-)
> > 
> > The leak was caused by missing 'unselect' of the cairo/win32
> > internal surface->bitmap. Failing to do so lets the following
> > DeleteObject(bitmap) call fail as well.
> > Also in case of a self-created dc that needs to be deleted, too.
> 
> Stupid question - can't we just delete the DC first rather
> than after the bitmap? won't that automatically unselect the bitmap
> and let us delete it afterwards?

Tried this and it seemed to work fine, so I committed that change.

Regards,
					Owen





More information about the cairo mailing list