Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/windowmanager/intern/wm_window.c')
-rw-r--r--source/blender/windowmanager/intern/wm_window.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 44200294b6c..630c3921a95 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -238,6 +238,8 @@ wmWindow *wm_window_copy(bContext *C, wmWindow *winorig)
/* this is event from ghost, or exit-blender op */
void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win)
{
+ bScreen *screen= win->screen;
+
BLI_remlink(&wm->windows, win);
wm_draw_window_clear(win);
@@ -246,14 +248,14 @@ void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win)
WM_event_remove_handlers(C, &win->modalhandlers);
ED_screen_exit(C, win, win->screen);
- /* if temp screen, delete it */
- if(win->screen->temp) {
+ wm_window_free(C, wm, win);
+
+ /* if temp screen, delete it after window free (it stops jobs that can access it) */
+ if(screen->temp) {
Main *bmain= CTX_data_main(C);
- free_libblock(&bmain->screen, win->screen);
+ free_libblock(&bmain->screen, screen);
}
- wm_window_free(C, wm, win);
-
/* check remaining windows */
if(wm->windows.first) {
for(win= wm->windows.first; win; win= win->next)
@@ -528,7 +530,12 @@ int wm_window_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
int wm_window_fullscreen_toggle_exec(bContext *C, wmOperator *UNUSED(op))
{
wmWindow *window= CTX_wm_window(C);
- GHOST_TWindowState state = GHOST_GetWindowState(window->ghostwin);
+ GHOST_TWindowState state;
+
+ if(G.background)
+ return OPERATOR_CANCELLED;
+
+ state= GHOST_GetWindowState(window->ghostwin);
if(state!=GHOST_kWindowStateFullScreen)
GHOST_SetWindowState(window->ghostwin, GHOST_kWindowStateFullScreen);
else