fixed a bug in DdDeleteDirectDrawObject
authorMagnus Olsen <magnus@greatlord.com>
Sat, 23 Dec 2006 12:25:07 +0000 (12:25 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Sat, 23 Dec 2006 12:25:07 +0000 (12:25 +0000)
Zero the DirectDraw handler if it have sussess been free

svn path=/trunk/; revision=25210

reactos/dll/win32/gdi32/misc/gdientry.c

index 9463b30..c72a0fb 100644 (file)
@@ -742,6 +742,10 @@ DdDeleteDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal)
     {
         /* Free it */
         Return = NtGdiDdDeleteDirectDrawObject((HANDLE)pDirectDrawGlobal->hDD);
+        if (Return == TRUE)
+        {
+            pDirectDrawGlobal->hDD = 0;
+        }
     }
     else if (ghDirectDraw)
     {
@@ -753,7 +757,10 @@ DdDeleteDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal)
         {
             /* Delete the object */
             Return = NtGdiDdDeleteDirectDrawObject(ghDirectDraw);
-            ghDirectDraw = 0;
+            if (Return == TRUE)
+            {
+                ghDirectDraw = 0;
+            }
         }
     }