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>2014-01-19 17:57:48 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-01-19 18:02:53 +0400
commitd358f1f9e7c1870049834842e6eecad93dcea731 (patch)
tree2b7c460ef13fa58fa2ad08c245b8181f5d7c51f8 /source/blender/editors/interface/view2d_ops.c
parent621bf47e91b21f4f08ba87023c6e69368c3cf9b7 (diff)
Fix last part of T38244: memory leak when scaling any panel
Issue is not noticeable with default font, but i18n one can use more than 500Mo of ram when cached in undreds of different sizes. Campbell had already done most of the work in rBa780e7f3f09f and rB6b283f116829, just had to call BLF_cache_clear() in _exit funcs of VIEW2D_zoom & co operators.
Diffstat (limited to 'source/blender/editors/interface/view2d_ops.c')
-rw-r--r--source/blender/editors/interface/view2d_ops.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index d39c8340626..d299b72b881 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -38,6 +38,8 @@
#include "BLI_utildefines.h"
#include "BLI_math_base.h"
+#include "BLF_api.h"
+
#include "BKE_context.h"
#include "RNA_access.h"
@@ -46,7 +48,6 @@
#include "WM_api.h"
#include "WM_types.h"
-
#include "ED_screen.h"
#include "UI_view2d.h"
@@ -663,6 +664,10 @@ static void view_zoomstep_apply(bContext *C, wmOperator *op)
/* cleanup temp customdata */
static void view_zoomstep_exit(wmOperator *op)
{
+ /* Fonts are stored at each DPI level, without this we can easy load 100's of fonts.
+ * Not an issue with embedded font, but can use over 500Mo with i18n ones! See T38244. */
+ BLF_cache_clear();
+
if (op->customdata) {
MEM_freeN(op->customdata);
op->customdata = NULL;
@@ -894,6 +899,10 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op)
/* cleanup temp customdata */
static void view_zoomdrag_exit(bContext *C, wmOperator *op)
{
+ /* Fonts are stored at each DPI level, without this we can easy load 100's of fonts.
+ * Not an issue with embedded font, but can use over 500Mo with i18n ones! See T38244. */
+ BLF_cache_clear();
+
if (op->customdata) {
v2dViewZoomData *vzd = op->customdata;