summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows/window.cpp
diff options
context:
space:
mode:
author Brad Hughes <bradhugh@outlook.com>2016-04-18 11:32:03 -0400
committer Brad Hughes <bradhugh@outlook.com>2016-04-18 11:32:03 -0400
commitafbb4b658162c2b8574c7ce82504e9fdfdd8d642 (patch)
treedebf37dd0bac5d16817f35035193d71959b51d5f /src/osd/windows/window.cpp
parent870db16e99efcb64a95ca1e321e8dacc389ce53e (diff)
Check that we have a window before updating cursor state
Diffstat (limited to 'src/osd/windows/window.cpp')
-rw-r--r--src/osd/windows/window.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp
index 612e55237e8..0dd6f46aeae 100644
--- a/src/osd/windows/window.cpp
+++ b/src/osd/windows/window.cpp
@@ -728,14 +728,18 @@ void winwindow_update_cursor_state(running_machine &machine)
assert(GetCurrentThreadId() == main_threadid);
win_window_info *window = win_window_list;
+
+ // If no window yet, just return
+ if (window == nullptr)
+ return;
// if we should hide the mouse cursor, then do it
// rules are:
// 1. we must have focus before hiding the cursor
- // 2. we also hide the cursor in full screen mode and when the window doesn't have a menu
+ // 2. we also hide the cursor in full screen mode and when tshe window doesn't have a menu
// 3. we also hide the cursor in windowed mode if we're not paused and
// the input system requests it
- if (winwindow_has_focus() && ((!video_config.windowed && !win_window_list->win_has_menu()) || (!machine.paused() && downcast<windows_osd_interface&>(machine.osd()).should_hide_mouse())))
+ if (winwindow_has_focus() && ((!video_config.windowed && !window->win_has_menu()) || (!machine.paused() && downcast<windows_osd_interface&>(machine.osd()).should_hide_mouse())))
{
// hide cursor
window->hide_pointer();