From 9006f25ebac1d3982609cd0b17bbb4c702c24bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 27 Jan 2002 00:48:16 +0000 Subject: [PATCH] prevent crash when trying to set global cursor too early git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13848 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mgl/cursor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mgl/cursor.cpp b/src/mgl/cursor.cpp index f1ce135b33..896f2d4f62 100644 --- a/src/mgl/cursor.cpp +++ b/src/mgl/cursor.cpp @@ -203,12 +203,14 @@ void wxSetCursor(const wxCursor& cursor) { if ( cursor.Ok() ) { - MGL_wmSetGlobalCursor(g_winMng, *cursor.GetMGLCursor()); + if ( g_winMng ) + MGL_wmSetGlobalCursor(g_winMng, *cursor.GetMGLCursor()); gs_globalCursor = cursor; } else { - MGL_wmSetGlobalCursor(g_winMng, NULL); + if ( g_winMng ) + MGL_wmSetGlobalCursor(g_winMng, NULL); gs_globalCursor = wxNullCursor; } }