From 960de09ed1ff66fee8a0c14fc3f9cff3b64bbcbb Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 26 Aug 2008 01:58:33 +0400 Subject: [PATCH] gdiplus: GdipDeleteGraphics affected by busy state too. Test added. --- dlls/gdiplus/graphics.c | 2 ++ dlls/gdiplus/tests/graphics.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index bff1c862f52..ef2aff76aea 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -889,6 +889,8 @@ GpStatus WINGDIPAPI GdipCreateStreamOnFile(GDIPCONST WCHAR * filename, GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics) { if(!graphics) return InvalidParameter; + if(graphics->busy) return ObjectBusy; + if(graphics->hwnd) ReleaseDC(graphics->hwnd, graphics->hdc); diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 90a416c5ffb..97702118667 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -714,6 +714,9 @@ static void test_Get_Release_DC(void) status = GdipMultiplyWorldTransform(graphics, m, MatrixOrderPrepend); status = GdipGetClip(graphics, region); expect(ObjectBusy, status); status = Ok; + /* try to delete before release */ + status = GdipDeleteGraphics(graphics); + expect(ObjectBusy, status); status = GdipReleaseDC(graphics, retdc); expect(Ok, status); -- 2.11.4.GIT