Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Swaney <sswaney@centurytel.net>2003-11-11 13:13:04 +0300
committerStephen Swaney <sswaney@centurytel.net>2003-11-11 13:13:04 +0300
commit011203c45f7ce01e03ee90edd2b14ffcba627a97 (patch)
treee9e11fa03fb1f44e8f851380fb64d16e3dbd99b7 /source/blender/python/api2_2x/Text.c
parent1018943b3d14e4bd30f0ea7416bdeeb4fc7cea83 (diff)
fixed the bug Joseph Gilbert found in numerous python files.
newly created data objs had incorrect user counts.
Diffstat (limited to 'source/blender/python/api2_2x/Text.c')
-rw-r--r--source/blender/python/api2_2x/Text.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Text.c b/source/blender/python/api2_2x/Text.c
index 41fd6c99f60..e2819de3bab 100644
--- a/source/blender/python/api2_2x/Text.c
+++ b/source/blender/python/api2_2x/Text.c
@@ -49,8 +49,12 @@ static PyObject *M_Text_New(PyObject *self, PyObject *args, PyObject *keywords)
bl_text = add_empty_text();
- if (bl_text)
+ if (bl_text) {
+ /* return user count to zero because add_empty_text() inc'd it */
+ bl_text->id.us = 0;
+ /* create python wrapper obj */
py_text = Text_CreatePyObject (bl_text);
+ }
else
return EXPP_ReturnPyObjError (PyExc_RuntimeError,
"couldn't create Text Object in Blender");