MSW: fix assertion failure on Open() error paths (fix #3889)
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 19 Jul 2010 17:32:55 +0000 (20:32 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 19 Jul 2010 17:32:55 +0000 (20:32 +0300)
Do not try to delete a callback and/or a mutex that do not exist.
The goto error paths still look a bit suspicious, someone should
double check them.

modules/video_output/msw/direct3d.c
modules/video_output/msw/directx.c

index c1c5956..14f2bc9 100644 (file)
@@ -184,7 +184,10 @@ static int Open(vlc_object_t *object)
 
     return VLC_SUCCESS;
 error:
-    Close(VLC_OBJECT(vd));
+    Direct3DClose(vd);
+    CommonClean(vd);
+    Direct3DDestroy(vd);
+    free(vd->sys);
     return VLC_EGENERIC;
 }
 
index 020725a..014a0d0 100644 (file)
@@ -236,7 +236,11 @@ static int Open(vlc_object_t *object)
     return VLC_SUCCESS;
 
 error:
-    Close(VLC_OBJECT(vd));
+    DirectXClose(vd);
+    CommonClean(vd);
+    if (sys->hddraw_dll)
+        FreeLibrary(sys->hddraw_dll);
+    free(sys);
     return VLC_EGENERIC;
 }