Commit 4a0a2ee0 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

Avoid deadlock in VGA_DoSetMode.

parent 470a3f93
...@@ -232,6 +232,18 @@ typedef struct { ...@@ -232,6 +232,18 @@ typedef struct {
int ret; int ret;
} ModeSet; } 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) static void WINAPI VGA_DoSetMode(ULONG_PTR arg)
{ {
LRESULT res; LRESULT res;
...@@ -239,7 +251,7 @@ static void WINAPI VGA_DoSetMode(ULONG_PTR arg) ...@@ -239,7 +251,7 @@ static void WINAPI VGA_DoSetMode(ULONG_PTR arg)
ModeSet *par = (ModeSet *)arg; ModeSet *par = (ModeSet *)arg;
par->ret=1; par->ret=1;
if (lpddraw) VGA_Exit(); if (lpddraw) VGA_DoExit(NULL);
if (!lpddraw) { if (!lpddraw) {
if (!pDirectDrawCreate) if (!pDirectDrawCreate)
{ {
...@@ -334,18 +346,6 @@ int VGA_GetMode(unsigned*Height,unsigned*Width,unsigned*Depth) ...@@ -334,18 +346,6 @@ int VGA_GetMode(unsigned*Height,unsigned*Width,unsigned*Depth)
return 0; 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) void VGA_Exit(void)
{ {
if (lpddraw) MZ_RunInThread(VGA_DoExit, 0); if (lpddraw) MZ_RunInThread(VGA_DoExit, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment