[1/4] gdiplus: GdipDeleteGraphics affected by busy state too. Test added.

Nikolay Sivov bunglehead at gmail.com
Mon Aug 25 16:58:33 CDT 2008


Changelog:
    - GdipDeleteGraphics affected by busy state too. Test added.

---
 dlls/gdiplus/graphics.c       |    2 ++
 dlls/gdiplus/tests/graphics.c |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index bff1c86..ef2aff7 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 90a416c..9770211 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);
-- 
1.4.4.4






More information about the wine-patches mailing list