Fix T71012: Cycles baking crash with locked-UI & background-mode

This commit is contained in:
Campbell Barton
2020-09-10 16:09:58 +10:00
parent d2d3ab05b3
commit 976b07056d

View File

@@ -723,7 +723,11 @@ void BlenderSync::free_data_after_sync(BL::Depsgraph &b_depsgraph)
* footprint during synchronization process.
*/
const bool is_interface_locked = b_engine.render() && b_engine.render().use_lock_interface();
const bool can_free_caches = BlenderSession::headless || is_interface_locked;
const bool can_free_caches = (BlenderSession::headless || is_interface_locked) &&
/* Baking re-uses the depsgraph multiple times, clearing crashes
* reading un-evaluated mesh data which isn't aligned with the
* geometry we're baking, see T71012. */
!scene->bake_manager->get_baking();
if (!can_free_caches) {
return;
}