[Bf-blender-cvs] [7884ae6eb27] master: Fix T53686: VSE Render crash when zooming timeline

Sergey Sharybin noreply at git.blender.org
Thu Feb 1 16:35:02 CET 2018


Commit: 7884ae6eb274bea0fe4739255a41a693df833b11
Author: Sergey Sharybin
Date:   Thu Feb 1 16:24:25 2018 +0100
Branches: master
https://developer.blender.org/rB7884ae6eb274bea0fe4739255a41a693df833b11

Fix T53686: VSE Render crash when zooming timeline

This is rather a workaround to avoid main thread freeing all glyph caches
at the same time as sequencer uses fonts to draw text sequences.

Ideally we need to either make cache more local, or user-counted or to make
somewhat more global locks. All this ends up in a bigger refactor which is
better for 2.8. For the meantime let's make Blender more stable with a tiny
workaround.

Downside is that keeping zooming things up and down in interface during render
will increase memory usage by unused glyph caches. It's not too bad though,
all unused caches will be freed first time at area zoom after render.

Thanks Bastien for review!

===================================================================

M	source/blender/editors/interface/view2d.c

===================================================================

diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 38432395a17..f2f4154160d 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -1027,6 +1027,13 @@ bool UI_view2d_tab_set(View2D *v2d, int tab)
 
 void UI_view2d_zoom_cache_reset(void)
 {
+	/* TODO(sergey): This way we avoid threading conflict with VSE rendering
+	 * text strip. But ideally we want to make glyph cache to be fully safe
+	 * for threading.
+	 */
+	if (G.is_rendering) {
+		return;
+	}
 	/* While scaling we can accumulate fonts at many sizes (~20 or so).
 	 * Not an issue with embedded font, but can use over 500Mb with i18n ones! See [#38244]. */



More information about the Bf-blender-cvs mailing list