diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2015-03-25 15:19:30 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2015-03-25 15:19:30 +0000 |
commit | fae3eaffcd4457c29db2ffc4a02c99c037fd3148 (patch) | |
tree | 13cd81e113e9a3e31afaa824c0781ea79c9492af /gtk/gtkglarea.c | |
parent | 85141bc503701b5e3a25fbb5a5982da4cadeec85 (diff) | |
download | gtk+-fae3eaffcd4457c29db2ffc4a02c99c037fd3148.tar.gz |
glarea: Check that the context is not NULL
The public API should perform more checks when it comes to an NULL
context.
https://bugzilla.gnome.org/show_bug.cgi?id=746746
Diffstat (limited to 'gtk/gtkglarea.c')
-rw-r--r-- | gtk/gtkglarea.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c index 1936a7b47c..90ab9fc523 100644 --- a/gtk/gtkglarea.c +++ b/gtk/gtkglarea.c @@ -448,6 +448,11 @@ gtk_gl_area_attach_buffers (GtkGLArea *area) { GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area); + g_return_if_fail (GTK_IS_GL_AREA (area)); + + if (priv->context == NULL) + return; + gtk_gl_area_make_current (area); if (!priv->have_buffers) @@ -631,6 +636,9 @@ gtk_gl_area_draw (GtkWidget *widget, return FALSE; } + if (priv->context == NULL) + return FALSE; + gtk_gl_area_make_current (area); gtk_gl_area_attach_buffers (area); @@ -1301,6 +1309,6 @@ gtk_gl_area_make_current (GtkGLArea *area) g_return_if_fail (gtk_widget_get_realized (widget)); - if (priv->context) + if (priv->context != NULL) gdk_gl_context_make_current (priv->context); } |