API Doc: Gotcha: add section about 'exceptions to the rules' known crashing cases.

As exposed in T62406, we can have some rare cases of crashes due to
memory re-allocation happening outside of expected scenarii.

Ideally this should be re-designed, but at least keep track of those
known exceptions to general rules...
This commit is contained in:
Bastien Montagne
2019-03-12 14:09:41 +01:00
parent d9c5436cf4
commit 8ba1c3072c

View File

@@ -633,6 +633,7 @@ Here are some general hints to avoid running into these problems.
fetch data from the context each time the script is activated. fetch data from the context each time the script is activated.
- Crashes may not happen every time, they may happen more on some configurations/operating-systems. - Crashes may not happen every time, they may happen more on some configurations/operating-systems.
- Be wary of recursive patterns, those are very efficient at hiding the issues described here. - Be wary of recursive patterns, those are very efficient at hiding the issues described here.
- See last sub-section about `Unfortunate Corner Cases`_ for some known breaking exceptions.
.. note:: .. note::
@@ -827,6 +828,17 @@ the next example will still crash.
print(vertices) # <- this may crash print(vertices) # <- this may crash
Unfortunate Corner Cases
------------------------
Besides all expected cases listed above, there are a few others that should not be
an issue but, due to internal implementation details, currently are:
- ``Object.hide_viewport``, ``Object.hide_select`` and ``Object.hide_render``:
Setting any of those booleans will trigger a rebuild of Collection caches, hence breaking
any current iteration over ``Collection.all_objects``.
sys.exit sys.exit
======== ========