WIP: use generic copy-on-write system to avoid unnecessary data copies #104470
|
@ -2382,7 +2382,9 @@ static void customData_free_layer__internal(CustomDataLayer *layer, const int to
|
|||
const LayerTypeInfo *typeInfo;
|
||||
|
||||
if (layer->anonymous_id != nullptr) {
|
||||
layer->anonymous_id->cow().user_remove();
|
||||
if (layer->anonymous_id->cow().user_remove()) {
|
||||
layer->anonymous_id->cow_delete_self();
|
||||
}
|
||||
layer->anonymous_id = nullptr;
|
||||
}
|
||||
if (!(layer->flag & CD_FLAG_NOFREE) && layer->data) {
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* \ingroup bli
|
||||
*/
|
||||
|
||||
#include "BLI_assert.h"
|
||||
#include "BLI_compiler_attrs.h"
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_utility_mixins.hh"
|
||||
|
||||
#include "DNA_copy_on_write.h"
|
||||
|
|
Loading…
Reference in New Issue