2.5: Fix for crash on reload file. Cursor grab should not
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 10 Jul 2009 11:33:01 +0000 (11:33 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 10 Jul 2009 11:33:01 +0000 (11:33 +0000)
assume there to be a window, but also reload file exec was
not returing an OPERATOR_* value.

source/blender/windowmanager/intern/wm_cursors.c
source/blender/windowmanager/intern/wm_files.c

index 5ddd8f5a1a9b1b26927df18276e893ea116b98fe..79830aca12fe21339580de556970f1eb14721d4a 100644 (file)
@@ -158,7 +158,8 @@ void WM_cursor_wait(int val)
 
 void WM_cursor_grab(wmWindow *win, int val)
 {
-       GHOST_SetCursorGrab(win->ghostwin, val);
+       if(win)
+               GHOST_SetCursorGrab(win->ghostwin, val);
 }
 
 /* afer this you can call restore too */
index 29ec58befd9d815721ec6e0902e903185c9fcd7a..51389ef890c38c9d06d453dc55a7b67e3089ec70 100644 (file)
@@ -334,8 +334,8 @@ int WM_read_homefile(bContext *C, wmOperator *op)
        
        WM_event_add_notifier(C, NC_WM|ND_FILEREAD, NULL);
        CTX_wm_window_set(C, NULL); /* exits queues */
-                                  
-       return success;
+
+       return OPERATOR_FINISHED;
 }