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:
authorBastien Montagne <montagne29@wanadoo.fr>2013-01-24 15:38:17 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-01-24 15:38:17 +0400
commit61461102701f3f115a603e4bb63069d1112e8368 (patch)
tree469601cc4568a6f7f0bd10bec4a2ce9d6f914a48 /source/blender/python/intern/bpy_app_translations.c
parent66bf63d7af52762a81876adc2907c4fc414716f9 (diff)
Final memory fix for bpy.app.translations (not really a leak, but unfreed memory at end of program - I thought addons were unregistered at quit time...).
Diffstat (limited to 'source/blender/python/intern/bpy_app_translations.c')
-rw-r--r--source/blender/python/intern/bpy_app_translations.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c
index dffa8f20fa3..e9495b3e761 100644
--- a/source/blender/python/intern/bpy_app_translations.c
+++ b/source/blender/python/intern/bpy_app_translations.c
@@ -608,6 +608,14 @@ static PyObject *app_translations_new(PyTypeObject *type, PyObject *UNUSED(args)
return (PyObject *)_translations;
}
+void app_translations_free(void *obj)
+{
+ PyObject_Del(obj);
+#ifdef WITH_INTERNATIONAL
+ _clear_translations_cache();
+#endif
+}
+
PyDoc_STRVAR(app_translations_doc,
" This object contains some data/methods regarding internationalization in Blender, and allows every py script\n"
" to feature translations for its own UI messages.\n"
@@ -700,7 +708,7 @@ static PyTypeObject BlenderAppTranslationsType = {
/* newfunc tp_new; */
(newfunc)app_translations_new,
/* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
+ app_translations_free, /* freefunc tp_free; */
/* For PyObject_IS_GC */
NULL, /* inquiry tp_is_gc; */
NULL, /* PyObject *tp_bases; */