diff --git a/clutter/clutter/clutter-offscreen-effect.c b/clutter/clutter/clutter-offscreen-effect.c index 1dbf29f60..5db40b79a 100644 --- a/clutter/clutter/clutter-offscreen-effect.c +++ b/clutter/clutter/clutter-offscreen-effect.c @@ -186,6 +186,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) @@ -196,9 +202,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) {