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 {
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);
......
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