diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 74ae8b9b7..556697723 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -525,13 +525,16 @@ void CTextBox::refreshText(void) //Paint Text Background if (m_nPaintBackground){ - if (m_bgpixbuf) + if (m_bgpixbuf){ delete[] m_bgpixbuf; - m_bgpixbuf = NULL; + m_bgpixbuf = NULL; + } frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType); } - else - frameBuffer->RestoreScreen(ax, ay, dx, dy, m_bgpixbuf); + else{ + if (m_bgpixbuf) + frameBuffer->RestoreScreen(ax, ay, dx, dy, m_bgpixbuf); + } if( m_nNrOfLines <= 0) return;