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>2015-04-01 10:34:01 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-04-01 10:34:01 +0300
commitf7dbce9914a86952b1a9ca2657a3c735cb693ef1 (patch)
tree5d4f6b6ecb7c40c0aaff4ed328f1aa5da5bf33c9 /source/blender/python
parent6461fbd9ce1f6cbaded1a53b689ea190b6f22f5e (diff)
Real fix for T44127: Python does not guarantee to free all objects on exit...
All kudos to Campbell for the head-up and patch!
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_app_translations.c9
-rw-r--r--source/blender/python/intern/bpy_app_translations.h1
-rw-r--r--source/blender/python/intern/bpy_interface.c5
3 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c
index 123b111f3cb..ae5ea88abdf 100644
--- a/source/blender/python/intern/bpy_app_translations.c
+++ b/source/blender/python/intern/bpy_app_translations.c
@@ -821,3 +821,12 @@ PyObject *BPY_app_translations_struct(void)
return ret;
}
+
+void BPY_app_translations_end(void)
+{
+ /* Incase the object remains in a module's namespace, see T44127. */
+#ifdef WITH_INTERNATIONAL
+ _clear_translations_cache();
+#endif
+}
+
diff --git a/source/blender/python/intern/bpy_app_translations.h b/source/blender/python/intern/bpy_app_translations.h
index 704307574d0..e04c2484ecc 100644
--- a/source/blender/python/intern/bpy_app_translations.h
+++ b/source/blender/python/intern/bpy_app_translations.h
@@ -28,5 +28,6 @@
#define __BPY_APP_TRANSLATIONS_H__
PyObject *BPY_app_translations_struct(void);
+void BPY_app_translations_end(void);
#endif /* __BPY_APP_TRANSLATIONS_H__ */
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 5b4db89a41a..690ea115fcd 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -61,6 +61,8 @@
#include "bpy_traceback.h"
#include "bpy_intern_string.h"
+#include "bpy_app_translations.h"
+
#include "DNA_text_types.h"
#include "BKE_appdir.h"
@@ -358,6 +360,9 @@ void BPY_python_end(void)
bpy_intern_string_exit();
+ /* bpy.app modules that need cleanup */
+ BPY_app_translations_end();
+
#ifndef WITH_PYTHON_MODULE
BPY_atexit_unregister(); /* without this we get recursive calls to WM_exit */