Delete old TextRenderer after new one is in place

This commit is contained in:
David Rowe 2015-07-01 13:19:46 -07:00
parent 215c260c9e
commit e85eb246d2

View file

@ -174,6 +174,7 @@ QSizeF TextOverlay::textSize(const QString& text) const {
void TextOverlay::setFontSize(int fontSize) {
_fontSize = fontSize;
delete _textRenderer;
auto oldTextRenderer = _textRenderer;
_textRenderer = TextRenderer::getInstance(SANS_FONT_FAMILY, _fontSize, DEFAULT_FONT_WEIGHT);
delete oldTextRenderer;
}