mirror of https://github.com/mpv-player/mpv
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:
parent
be10a06c84
commit
70fe8d12fa
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue