renderer: Assert having been unrealized in dispose

We cannot unrealize a renderer in the dispose function, because that
would cause this chain to happen:
  gsk_gl_renderer_dispose
  gsk_renderer_dispose
  gsk_renderer_unrealize
  gsk_gl_renderer_unrealize
So we would call into thje GL renderers unrealize when it has already
(partially) disposed itself and ause accesses to dead variables.
This commit is contained in:
Benjamin Otte 2017-11-04 15:09:43 +01:00
parent 4c2bae3a1a
commit bd287ba3cf

View File

@ -170,7 +170,9 @@ gsk_renderer_dispose (GObject *gobject)
GskRenderer *self = GSK_RENDERER (gobject);
GskRendererPrivate *priv = gsk_renderer_get_instance_private (self);
gsk_renderer_unrealize (self);
/* We can't just unrealize here because superclasses have already run dispose.
* So we insist that unrealize must be called before unreffing. */
g_assert (!priv->is_realized);
g_clear_object (&priv->profiler);
g_clear_object (&priv->display);