st: Fix offscreen leak if cogl_framebuffer_allocate fails

If cogl_framebuffer_allocate fails in _st_create_shadow_pipeline_from_actor, the
CoglOffscreen* that was allocated earlier in the function is leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=735705

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
This commit is contained in:
Aaron Plattner 2016-03-18 16:00:05 -07:00 committed by Ray Strode
parent a9bb0558bc
commit 941513b280

View File

@ -442,6 +442,7 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
if (!cogl_framebuffer_allocate (fb, &catch_error)) if (!cogl_framebuffer_allocate (fb, &catch_error))
{ {
cogl_error_free (catch_error); cogl_error_free (catch_error);
cogl_object_unref (offscreen);
cogl_object_unref (buffer); cogl_object_unref (buffer);
return NULL; return NULL;
} }