Go to file
Bastien Montagne 85c9aefe0f "Fix" crash when deleting linked object which has indirect usages.
This is in fact very hairy situation here... Objects are only refcounted by scenes,
any other usage is 'free', which means once all object instanciations are gone Blender
considers it can delete it.

There is a trap here though: indirect usages. Typically, we should never modify linked data
(because it is essencially useless, changes would be ignored and ost on next reload or
even undo/redo). This means indirect usages are not affected by default 'safe' remapping/unlinking.

For unlinking preceeding deletion however, this is not acceptable - we are likely to end with
a zero-user ID (aka deletable one) which is still actually used by other linked data.

Solution choosen here is double:
I) From 'user-space' (i.e. outliner, operators...), we check for cases where deleting datablocks
should not be allowed (indirect data or indirectly used data), and abort (with report) if needed.
II) From 'lower' level (BKE_library_remap and RNA), we also unlink from linked data,
which makes actual deletion possible and safe.

Note that with previous behavior (2.77 one), linked object would be deleted, including from linked data -
but then, once file is saved and reloaded, indirect usage would link back the deleted object,
without any instanciation in scene, which made it somehow virtual and unreachable...

With new behavior, this is no more possible, but on the other hand it means that in situations of dependency cycles
(two linked objects using each other), linked objects become impossible to delete (from user space).

Not sure what's best here, behavior with those corner cases of library linking is very poorly defined... :(
2016-07-01 18:29:12 +02:00
build_files BGE: DeckLink card support for video capture and streaming. 2016-06-11 22:26:05 +02:00
doc T48694: fix bge.texture.Texture.refresh() documentation 2016-06-21 23:23:05 +02:00
extern Curve Fitting: add high-quality flag 2016-06-14 02:27:32 +10:00
intern Fix T48732: New GGX breaks OpenCL kernel 2016-06-28 17:15:35 +05:00
release UI: move dyntopo button to header 2016-07-01 21:44:31 +10:00
source "Fix" crash when deleting linked object which has indirect usages. 2016-07-01 18:29:12 +02:00
tests BLI_array_utils: add BLI_array_rfindindex 2016-06-23 11:36:49 +10:00
.arcconfig Use HTTPS protocol for arc 2013-12-24 22:57:27 +06:00
.gitignore Git ignore BUILD_NOTES.txt from install_deps.sh. 2015-11-23 20:17:02 +01:00
.gitmodules Remove SCons building system 2016-01-04 14:20:48 +05:00
CMakeLists.txt Fix OS X build after Decklink changes, it is not supported yet so don't enable it. 2016-06-11 23:50:06 +02:00
COPYING
GNUmakefile Makefile: Use hidden FORCE target 2016-05-21 05:48:10 +10:00
make.bat Fix make.bat checking 64bit systems 2016-02-10 00:26:12 +11:00