WIP: Add a mechanism to abort a blend file reading on critical error. #105085

Closed
Bastien Montagne wants to merge 1 commits from mont29:F-abort-file-reading into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

1 Commits

Author SHA1 Message Date
Bastien Montagne 3dc8035e1f WIP: Add a mechanism to abort a blend file reading on critical error.
This commit introduces a new Main boolean flag that marks is as invalid.

Higher-level file reading code does checks on this flag to abort reading
process if needed.

This is an implementation of the #105083 design task.

------------------------------

Write tests to validate at least the basics of this new mechanism.

------------------------------

Some notes:

This commit also has a fix to Main freeing function in case it is in
'split' state. This should be committed separately.

There is a memleak from `read_libblock`, not clear whether this is caused
by the forged .blend file or this patch yet.

The only actual change currently is adding a check on bScreen->scene
pointer being non-NULL (related to #99836), but we likely want way more
usages of this 'abort fileread'.

Given the extense of the change, I do not think this should be
considered for 3.5 and previous LTS releases. For these a simple 'check
and assign first available scene' "fix" would probably be enough to
address #99836 ?
2023-02-28 18:24:56 +01:00