diff --git a/clutter/clutter/clutter-offscreen-effect.c b/clutter/clutter/clutter-offscreen-effect.c index e23870f42..b612b0494 100644 --- a/clutter/clutter/clutter-offscreen-effect.c +++ b/clutter/clutter/clutter-offscreen-effect.c @@ -184,6 +184,12 @@ update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height) priv->texture = NULL; } + if (priv->offscreen != NULL) + { + cogl_handle_unref (priv->offscreen); + priv->offscreen = NULL; + } + priv->texture = clutter_offscreen_effect_create_texture (self, fbo_width, fbo_height); if (priv->texture == NULL) @@ -194,9 +200,6 @@ update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height) priv->fbo_width = fbo_width; priv->fbo_height = fbo_height; - if (priv->offscreen != NULL) - cogl_handle_unref (priv->offscreen); - priv->offscreen = cogl_offscreen_new_to_texture (priv->texture); if (priv->offscreen == NULL) {