context: Don't forget to unref() the renderer if we create it ourselves

cogl_display_new() takes a ref on the renderer, so code creating a
renderer and not keeping a pointer to it do unref later needs to drop
the ref immediately.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 5433555f19ac73f3f236026f1bafca758d63c9fa)
This commit is contained in:
Damien Lespiau 2013-07-12 01:05:12 +01:00 committed by Neil Roberts
parent 4d5af45d99
commit 1e4e68e069

View File

@ -196,6 +196,7 @@ cogl_context_new (CoglDisplay *display,
}
display = cogl_display_new (renderer, NULL);
cogl_object_unref(renderer);
}
else
cogl_object_ref (display);