void WM_autosave_init(wmWindowManager *wm) { wm_autosave_timer_ended(wm); if (U.flag & USER_AUTOSAVE) wm->autosavetimer = WM_event_add_timer(wm, NULL, TIMERAUTOSAVE, U.savetime * 60.0); }
/* context is allowed to be NULL, do not free wm itself (library.c) */ void wm_close_and_free(bContext *C, wmWindowManager *wm) { wmWindow *win; wmOperator *op; wmKeyConfig *keyconf; if(wm->autosavetimer) wm_autosave_timer_ended(wm); while((win= wm->windows.first)) { BLI_remlink(&wm->windows, win); win->screen= NULL; /* prevent draw clear to use screen */ wm_draw_window_clear(win); wm_window_free(C, wm, win); } while((op= wm->operators.first)) { BLI_remlink(&wm->operators, op); WM_operator_free(op); } while((keyconf=wm->keyconfigs.first)) { BLI_remlink(&wm->keyconfigs, keyconf); WM_keyconfig_free(keyconf); } BLI_freelistN(&wm->queue); BLI_freelistN(&wm->paintcursors); BLI_freelistN(&wm->drags); wm_reports_free(wm); if(C && CTX_wm_manager(C)==wm) CTX_wm_manager_set(C, NULL); }