diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-15 13:25:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-15 13:36:50 +0300 |
commit | e375685e06d0b4c52a0aacb8982684e45b490d5c (patch) | |
tree | 99f832891b05d72af98b4fe68ef0b10187da8332 /source/blender/editors/util | |
parent | 01029c68d293593ccf5019793a5b577b3b522338 (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/editors/util')
-rw-r--r-- | source/blender/editors/util/ed_util.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 188d06cec55..30021d6a0c9 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -157,12 +157,11 @@ void ED_editors_init(bContext *C) } /* frees all editmode stuff */ -void ED_editors_exit(bContext *C) +void ED_editors_exit(Main *bmain) { - Main *bmain = CTX_data_main(C); - - if (!bmain) + if (!bmain) { return; + } /* frees all editmode undos */ if (G_MAIN->wm.first) { @@ -198,11 +197,10 @@ void ED_editors_exit(bContext *C) /* flush any temp data from object editing to DNA before writing files, * rendering, copying, etc. */ -bool ED_editors_flush_edits(const bContext *C, bool for_render) +bool ED_editors_flush_edits(Main *bmain, bool for_render) { bool has_edited = false; Object *ob; - Main *bmain = CTX_data_main(C); /* loop through all data to find edit mode or object mode, because during * exiting we might not have a context for edit object and multiple sculpt @@ -400,7 +398,8 @@ void ED_spacedata_id_remap(struct ScrArea *sa, struct SpaceLink *sl, ID *old_id, static int ed_flush_edits_exec(bContext *C, wmOperator *UNUSED(op)) { - ED_editors_flush_edits(C, false); + Main *bmain = CTX_data_main(C); + ED_editors_flush_edits(bmain, false); return OPERATOR_FINISHED; } |