As mentioned in the pydrivers commit, I had to change the order in
authorWillian Padovani Germano <wpgermano@gmail.com>
Tue, 2 May 2006 02:42:08 +0000 (02:42 +0000)
committerWillian Padovani Germano <wpgermano@gmail.com>
Tue, 2 May 2006 02:42:08 +0000 (02:42 +0000)
commit35b8dac2ca3bf8b2cdd51c8a7a071321f26753ba
tree63ddde059b59ed8d4714630fc8d4b21ed154f577
parent30f4f3e2c4175e716c2aeb929bcfb9486ded18ae
As mentioned in the pydrivers commit, I had to change the order in
exit_usiblender() to finalize Python before main library data was freed.
This solved a somewhat specific sigsegv with pydrivers, but as Ken
Hughes found out (thanks!) caused one with scripts that called Blender.Exit().

Now running scripts (G.main->script) are freed in BPY_end_python()
itself (so before the rest of the library data is freed), before
Py_Finalize(). Works fine in all my tests so far.

The file script.c should become obsolete with this change (I added a
comment about it there). If all is indeed fine, it will be removed
later.
source/blender/blenkernel/intern/script.c
source/blender/python/BPY_interface.c