[1/2] gdiplus: Don't keep a reference to HDC in the GpBitmap object.

Dmitry Timoshkov dmitry at baikal.ru
Fri Jul 27 09:25:22 CDT 2012

Vincent Povirk <madewokherd at gmail.com> wrote:

> > an image passed to GdipGetImageGraphicsContext() is destroyed right after
> > the graphics object was created, then later on all calls using that HDC fail
> > and silently lead to using invalid or not initilazed values.
> You have to keep the image alive as long as you're using the Graphics
> object. If you're not doing that, then you have a use-after-free and I
> don't trust the results of your test.

You are welcome to experiment with the test and try to prove that its
results depend on the availability of an image. My tests show that image
after the GdipGetImageGraphicsContext() call can be safely destroyed,
and the test results don't depend on it.


More information about the wine-devel mailing list