forked from bartvdbraak/blender
Fix #29162: grease pencil did not decrement user count on adding new datablock
to replace an existing one.
This commit is contained in:
parent
010cd66747
commit
45b8a61bf3
@ -183,7 +183,10 @@ static int gp_data_add_exec (bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
else {
|
||||
/* just add new datablock now */
|
||||
/* decrement user count and add new datablock */
|
||||
bGPdata *gpd= (*gpd_ptr);
|
||||
|
||||
id_us_min(&gpd->id);
|
||||
*gpd_ptr= gpencil_data_addnew("GPencil");
|
||||
}
|
||||
|
||||
@ -231,7 +234,7 @@ static int gp_data_unlink_exec (bContext *C, wmOperator *op)
|
||||
/* just unlink datablock now, decreasing its user count */
|
||||
bGPdata *gpd= (*gpd_ptr);
|
||||
|
||||
gpd->id.us--;
|
||||
id_us_min(&gpd->id);
|
||||
*gpd_ptr= NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user