display: destroy display on creation failure.

This allows element to detect that the display creation has actually
failed.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
Nicolas Dufresne 2011-10-13 17:08:13 -04:00 committed by Gwenole Beauchesne
parent 8a1dc4978f
commit e5abbe0440

View file

@ -503,7 +503,8 @@ gst_vaapi_display_constructed(GObject *object)
GObjectClass *parent_class;
display->priv->create_display = display->priv->display == NULL;
gst_vaapi_display_create(display);
if (!gst_vaapi_display_create(display))
gst_vaapi_display_destroy(display);
parent_class = G_OBJECT_CLASS(gst_vaapi_display_parent_class);
if (parent_class->constructed)