summaryrefslogtreecommitdiff
path: root/gtk/gtkglarea.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-01-17 19:48:33 -0500
committerMatthias Clasen <mclasen@redhat.com>2018-01-17 19:48:33 -0500
commit6ea827cde5b97d1681d269a8200c26189a4213bd (patch)
treebc8ea760a88b2bffa5bec107e191f9d161f27a4b /gtk/gtkglarea.c
parentcdb2fcb554500d13d147c17b7126c556f87014ae (diff)
downloadgtk+-6ea827cde5b97d1681d269a8200c26189a4213bd.tar.gz
glarea: Avoid a crash
We must only delete the texture if it is not NULL.
Diffstat (limited to 'gtk/gtkglarea.c')
-rw-r--r--gtk/gtkglarea.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c
index efe4899cab..8e3cf4cc75 100644
--- a/gtk/gtkglarea.c
+++ b/gtk/gtkglarea.c
@@ -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