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:
authorCampbell Barton <ideasman42@gmail.com>2019-01-15 13:25:22 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-15 13:36:50 +0300
commite375685e06d0b4c52a0aacb8982684e45b490d5c (patch)
tree99f832891b05d72af98b4fe68ef0b10187da8332 /source/blender/windowmanager/intern/wm_init_exit.c
parent01029c68d293593ccf5019793a5b577b3b522338 (diff)
Cleanup: pass main instead of context w/ ED_editors_exit/flush_edits
Useful for calling from lower level code.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_init_exit.c')
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index e4ae9495c61..e3587c2c965 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -440,15 +440,16 @@ void WM_exit_ext(bContext *C, const bool do_python)
struct MemFile *undo_memfile = wm->undo_stack ? ED_undosys_stack_memfile_get_active(wm->undo_stack) : NULL;
if ((U.uiflag2 & USER_KEEP_SESSION) || (undo_memfile != NULL)) {
/* save the undo state as quit.blend */
+ Main *bmain = CTX_data_main(C);
char filename[FILE_MAX];
bool has_edited;
int fileflags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_HISTORY);
BLI_make_file_string("/", filename, BKE_tempdir_base(), BLENDER_QUIT_FILE);
- has_edited = ED_editors_flush_edits(C, false);
+ has_edited = ED_editors_flush_edits(bmain, false);
- if ((has_edited && BLO_write_file(CTX_data_main(C), filename, fileflags, NULL, NULL)) ||
+ if ((has_edited && BLO_write_file(bmain, filename, fileflags, NULL, NULL)) ||
(undo_memfile && BLO_memfile_write_file(undo_memfile, filename)))
{
printf("Saved session recovery to '%s'\n", filename);
@@ -480,8 +481,10 @@ void WM_exit_ext(bContext *C, const bool do_python)
WM_uilisttype_free();
/* all non-screen and non-space stuff editors did, like editmode */
- if (C)
- ED_editors_exit(C);
+ if (C) {
+ Main *bmain = CTX_data_main(C);
+ ED_editors_exit(bmain);
+ }
ED_undosys_type_free();