diff options
author | Ton Roosendaal <ton@blender.org> | 2010-12-03 21:39:40 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2010-12-03 21:39:40 +0300 |
commit | b036437a5b65ca37eb12028c47996b26f7a3b6d0 (patch) | |
tree | 856404de3c4b22bcf1d63e52f879c0da40abc012 /source/blender/editors/space_text | |
parent | 5ae3c5d321322b68138bf8c9d3637bbbcc443edc (diff) |
IRC bug report
Text editor, "Add new" caused zero-user block.
The claim in the code why it should be decreased is dubious.
Thanks wiseman!
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 32b71dbefb7..768a04e42c0 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -162,7 +162,9 @@ static int new_exec(bContext *C, wmOperator *UNUSED(op)) if(prop) { /* when creating new ID blocks, use is already 1, but RNA * pointer se also increases user, so this compensates it */ - text->id.us--; + /* doesnt always seem to happen... (ton) */ + if(text->id.us>1) + text->id.us--; RNA_id_pointer_create(&text->id, &idptr); RNA_property_pointer_set(&ptr, prop, idptr); |