Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/depsgraph.cc
| Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | |||||
| static void clear_id_nodes_conditional(Depsgraph::IDDepsNodes *id_nodes, const FilterFunc &filter) | static void clear_id_nodes_conditional(Depsgraph::IDDepsNodes *id_nodes, const FilterFunc &filter) | ||||
| { | { | ||||
| for (IDNode *id_node : *id_nodes) { | for (IDNode *id_node : *id_nodes) { | ||||
| if (id_node->id_cow == nullptr) { | if (id_node->id_cow == nullptr) { | ||||
| /* This means builder "stole" ownership of the copy-on-written | /* This means builder "stole" ownership of the copy-on-written | ||||
| * datablock for her own dirty needs. */ | * datablock for her own dirty needs. */ | ||||
| continue; | continue; | ||||
| } | } | ||||
| if (id_node->id_cow == id_node->id_orig) { | |||||
| /* Copy-on-write version is not needed for this ID type. | |||||
| * | |||||
| * NOTE: Is important to not de-reference the original datablock here because it might be | |||||
| * freed already (happens during main database free when some IDs are freed prior to a | |||||
| * scene). */ | |||||
sybren: Nice note :+1: | |||||
| continue; | |||||
| } | |||||
| if (!deg_copy_on_write_is_expanded(id_node->id_cow)) { | if (!deg_copy_on_write_is_expanded(id_node->id_cow)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| const ID_Type id_type = GS(id_node->id_cow->name); | const ID_Type id_type = GS(id_node->id_cow->name); | ||||
| if (filter(id_type)) { | if (filter(id_type)) { | ||||
| id_node->destroy(); | id_node->destroy(); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 192 Lines • Show Last 20 Lines | |||||
Nice note 👍