From 4a0a2ee00e9be20ed61416e302e3de2e0ed0a51e Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Sat, 11 May 2002 23:00:17 +0000 Subject: [PATCH] Avoid deadlock in VGA_DoSetMode. --- dlls/winedos/vga.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/dlls/winedos/vga.c b/dlls/winedos/vga.c index b386ed48153..cc80f6eef24 100644 --- a/dlls/winedos/vga.c +++ b/dlls/winedos/vga.c @@ -232,6 +232,18 @@ typedef struct { int ret; } ModeSet; +static void WINAPI VGA_DoExit(ULONG_PTR arg) +{ + VGA_DeinstallTimer(); + IDirectDrawSurface_SetPalette(lpddsurf,NULL); + IDirectDrawSurface_Release(lpddsurf); + lpddsurf=NULL; + IDirectDrawPalette_Release(lpddpal); + lpddpal=NULL; + IDirectDraw_Release(lpddraw); + lpddraw=NULL; +} + static void WINAPI VGA_DoSetMode(ULONG_PTR arg) { LRESULT res; @@ -239,7 +251,7 @@ static void WINAPI VGA_DoSetMode(ULONG_PTR arg) ModeSet *par = (ModeSet *)arg; par->ret=1; - if (lpddraw) VGA_Exit(); + if (lpddraw) VGA_DoExit(NULL); if (!lpddraw) { if (!pDirectDrawCreate) { @@ -334,18 +346,6 @@ int VGA_GetMode(unsigned*Height,unsigned*Width,unsigned*Depth) return 0; } -static void WINAPI VGA_DoExit(ULONG_PTR arg) -{ - VGA_DeinstallTimer(); - IDirectDrawSurface_SetPalette(lpddsurf,NULL); - IDirectDrawSurface_Release(lpddsurf); - lpddsurf=NULL; - IDirectDrawPalette_Release(lpddpal); - lpddpal=NULL; - IDirectDraw_Release(lpddraw); - lpddraw=NULL; -} - void VGA_Exit(void) { if (lpddraw) MZ_RunInThread(VGA_DoExit, 0);