fixed a bug in DdDeleteDirectDrawObject

Zero the DirectDraw handler if it have sussess been free

svn path=/trunk/; revision=25210
This commit is contained in:
Magnus Olsen 2006-12-23 12:25:07 +00:00
parent 412dfceb6a
commit 885e2ecded

View file

@ -742,6 +742,10 @@ DdDeleteDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal)
{ {
/* Free it */ /* Free it */
Return = NtGdiDdDeleteDirectDrawObject((HANDLE)pDirectDrawGlobal->hDD); Return = NtGdiDdDeleteDirectDrawObject((HANDLE)pDirectDrawGlobal->hDD);
if (Return == TRUE)
{
pDirectDrawGlobal->hDD = 0;
}
} }
else if (ghDirectDraw) else if (ghDirectDraw)
{ {
@ -753,9 +757,12 @@ DdDeleteDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal)
{ {
/* Delete the object */ /* Delete the object */
Return = NtGdiDdDeleteDirectDrawObject(ghDirectDraw); Return = NtGdiDdDeleteDirectDrawObject(ghDirectDraw);
if (Return == TRUE)
{
ghDirectDraw = 0; ghDirectDraw = 0;
} }
} }
}
/* Return */ /* Return */
return Return; return Return;