diff options
Diffstat (limited to 'source/blender/editors/space_text/text_ops.c')
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 4992a73f936..8f7bd83cbf4 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -241,6 +241,8 @@ static int text_new_exec(bContext *C, wmOperator *UNUSED(op)) PropertyRNA *prop; text = BKE_text_add(bmain, "Text"); + /* Texts have no user by default... Only the 'real' user flag. */ + id_us_min(&text->id); /* hook into UI */ UI_context_active_but_prop_get_templateID(C, &ptr, &prop); @@ -307,6 +309,8 @@ static int text_open_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "filepath", str); text = BKE_text_load_ex(bmain, str, BKE_main_blendfile_path(bmain), internal); + /* Texts have no user by default... Only the 'real' user flag. */ + id_us_min(&text->id); if (!text) { if (op->customdata) { @@ -322,8 +326,6 @@ static int text_open_exec(bContext *C, wmOperator *op) /* hook into UI */ pprop = op->customdata; - id_us_ensure_real(&text->id); - if (pprop->prop) { RNA_id_pointer_create(&text->id, &idptr); RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr, NULL); |