win32: don't crash if vo_w32_uninit() is called without vo_w32_init()

This is a recent regression. At least vo_direct3d uses vo_w32_uninit()
in this way, and crashed if initialization failed at an early point.
This commit is contained in:
wm4 2012-04-24 00:41:12 +02:00
parent be10a06c84
commit 70fe8d12fa
1 changed files with 2 additions and 0 deletions

View File

@ -742,6 +742,8 @@ void vo_w32_uninit(struct vo *vo)
{ {
struct vo_w32_state *w32 = vo->w32; struct vo_w32_state *w32 = vo->w32;
mp_msg(MSGT_VO, MSGL_V, "vo: win32: uninit\n"); mp_msg(MSGT_VO, MSGL_V, "vo: win32: uninit\n");
if (!w32)
return;
resetMode(vo); resetMode(vo);
ShowCursor(1); ShowCursor(1);
if (w32->dev_hdc) DeleteDC(w32->dev_hdc); if (w32->dev_hdc) DeleteDC(w32->dev_hdc);