diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-01-24 15:38:17 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-01-24 15:38:17 +0400 |
commit | 61461102701f3f115a603e4bb63069d1112e8368 (patch) | |
tree | 469601cc4568a6f7f0bd10bec4a2ce9d6f914a48 /source | |
parent | 66bf63d7af52762a81876adc2907c4fc414716f9 (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')
-rw-r--r-- | source/blender/python/intern/bpy_app_translations.c | 10 |
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; */ |