Fix another crash at app shutdown.

Context doesn't exist on all envs at shutdown.

Change-Id: I6c0398203f0ab3ceaa38f64936cdf375c43e9f55
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
This commit is contained in:
Miikka Heikkinen 2014-10-30 12:32:50 +02:00 committed by Tomi Korpipää
parent d430a51768
commit bed7f3fbf6
1 changed files with 2 additions and 3 deletions

View File

@ -54,10 +54,9 @@ GLuint LabelItem::textureId() const
void LabelItem::clear()
{
if (m_textureId) {
if (m_textureId && QOpenGLContext::currentContext())
QOpenGLContext::currentContext()->functions()->glDeleteTextures(1, &m_textureId);
m_textureId = 0;
}
m_textureId = 0;
m_size = QSize(0, 0);
}