File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/core/text-rendering/font-face-types/SdfTrFontFace Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,14 @@ export class SdfTrFontFace<
8989 // Load the texture
9090 stage . txManager . loadTexture ( this . texture , true ) ;
9191
92- this . texture . once ( 'loaded' , ( ) => {
92+ // FIXME This is a stop-gap solution to avoid Font Face textures to be cleaned up
93+ // Ideally we do want to clean up the textures if they're not being used to save as much memory as possible
94+ // However, we need to make sure that the font face is reloaded if the texture is cleaned up and needed again
95+ // and make sure the SdfFontRenderer is properly guarded against textures being reloaded
96+ // for now this will do the trick and the increase on memory is not that big
97+ this . texture . preventCleanup = true ;
98+
99+ this . texture . on ( 'loaded' , ( ) => {
93100 this . checkLoaded ( ) ;
94101 // Make sure we mark the stage for a re-render (in case the font's texture was freed and reloaded)
95102 stage . requestRender ( ) ;
You can’t perform that action at this time.
0 commit comments