Commit 654d74bf authored by Christian Hergert's avatar Christian Hergert
Browse files

gsk/gl: use critical instead of assert in dispose

Instead of asserting only in debug builds (which are generally not
shipped in distributions) we should deliver a critical log-level message
so that these can be found sooner when not developing with jhbuild,
Flatpak, etc.

Also assert that we've setup the state correctly when realizing the
GskGLRenderer object.

Fixes #4625
parent a26c72ef
Pipeline #398406 failed with stages
in 45 minutes and 47 seconds
......@@ -158,6 +158,10 @@ failure:
gdk_profiler_end_mark (start_time, "realize GskGLRenderer", NULL);
/* Assert either all or no state was set */
g_assert ((ret && self->driver != NULL && self->context != NULL && self->command_queue != NULL) ||
(!ret && self->driver == NULL && self->context == NULL && self->command_queue == NULL));
return ret;
......@@ -403,11 +407,11 @@ gsk_gl_renderer_render_texture (GskRenderer *renderer,
static void
gsk_gl_renderer_dispose (GObject *object)
GskGLRenderer *self = (GskGLRenderer *)object;
g_assert (self->driver == NULL);
if (self->driver != NULL)
g_critical ("Attempt to dispose %s without calling gsk_renderer_unrealize()",
G_OBJECT_CLASS (gsk_gl_renderer_parent_class)->dispose (object);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment