Fix missing user when opening text from ID UI widget.

Own mistake in recent fix for Text data-block usercount (rBa9163f7d2).

Reported by @sergey over IRC, thanks.
This commit is contained in:
Bastien Montagne 2017-01-13 18:12:56 +01:00
parent e5a665fe24
commit 646aa40cf7
Notes: blender-bot 2023-02-14 19:28:50 +01:00
Referenced by issue blender/blender-addons#55260, load Text File with Python from GUI Button results in 0 User
1 changed files with 1 additions and 0 deletions

View File

@ -248,6 +248,7 @@ static int text_open_exec(bContext *C, wmOperator *op)
pprop = op->customdata;
if (pprop->prop) {
id_us_ensure_real(&text->id);
RNA_id_pointer_create(&text->id, &idptr);
RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr);
RNA_property_update(C, &pprop->ptr, pprop->prop);