From: Toni Wilen Date: Sat, 28 Apr 2018 12:25:06 +0000 (+0300) Subject: Fix crash when switching CPU modes in lagless vsync. X-Git-Tag: 4000~93 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=215132015dee597dda6ea02cd61dd8a3cef72ba0;p=francis%2Fwinuae.git Fix crash when switching CPU modes in lagless vsync. --- diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 3aff5215..27e598dd 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -490,7 +490,7 @@ static void display_vblank_thread(struct AmigaMonitor *mon) return; // It seems some Windows 7 drivers stall if D3DKMTWaitForVerticalBlankEvent() // and D3DKMTGetScanLine() is used simultaneously. - if (os_win8 && ap->gfx_vsyncmode && pD3DKMTWaitForVerticalBlankEvent && wait_vblank_display->HasAdapterData) { + if (os_win8 && ap->gfx_vsyncmode && pD3DKMTWaitForVerticalBlankEvent && wait_vblank_display && wait_vblank_display->HasAdapterData) { waitvblankevent = CreateEvent(NULL, FALSE, FALSE, NULL); waitvblankthread_mode = 1; unsigned int th;