glarea: Avoid a crash

We must only delete the texture if it is not NULL.
This commit is contained in:
Matthias Clasen 2018-01-17 19:48:33 -05:00
parent cdb2fcb554
commit 6ea827cde5

View File

@ -601,8 +601,11 @@ gtk_gl_area_delete_textures (GtkGLArea *area)
{
GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
delete_one_texture (priv->texture);
priv->texture = NULL;
if (priv->texture)
{
delete_one_texture (priv->texture);
priv->texture = NULL;
}
/* FIXME: we need to explicitly release all outstanding
* textures here, otherwise release_texture will get called