From ac4fd3f8b23769a4e3e66c84d89712c3477b08de Mon Sep 17 00:00:00 2001 From: Nimetu Date: Wed, 10 Apr 2019 00:31:37 +0300 Subject: [PATCH] Fixed: Changing font name for already rendered text leading to crash. --HG-- branch : develop --- code/nel/src/gui/view_text.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index 45adbe245..cf3857102 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -1440,12 +1440,11 @@ namespace NLGUI if (_FontName == name) return; - if (_FontName.length() > 0) - { - if (_Index != 0xFFFFFFFF) - CViewRenderer::getTextContext(_FontName)->erase (_Index); - clearLines(); - } + if (_Index != 0xFFFFFFFF) + CViewRenderer::getTextContext(_FontName)->erase (_Index); + clearLines(); + + resetTextIndex(); _FontName = name; computeFontSize ();