add: if (gtx->priv->vo_driver != NULL) xine_close_video_driver (gtx->priv->xine, gtx->priv->vo_driver); if (gtx->priv->vo_driver != NULL) xine_close_audio_driver (gtx->priv->xine, gtx->priv->ao_driver);
context: gtk_xine_unrealize (GtkWidget *widget){	GtkXine *gtx;	char *configfile;	g_return_if_fail (widget != NULL);	g_return_if_fail (GTK_IS_XINE (widget));	/* Hide all windows */	if (GTK_WIDGET_MAPPED (widget))		gtk_widget_unmap (widget);	GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);	gtx = GTK_XINE (widget);	/* stop the playback */	xine_close (gtx->priv->stream);	gtx->priv->stream = NULL;	/* stop the event thread */	pthread_cancel (gtx->priv->thread);	/* save config */	configfile = g_build_path (G_DIR_SEPARATOR_S,			g_get_home_dir (), CONFIG_FILE, NULL);	xine_config_save (gtx->priv->xine, configfile);	g_free (configfile);	/* stop event thread */	xine_exit (gtx->priv->xine);	gtx->priv->xine = NULL;	/* This destroys widget->window and unsets the realized flag */	if (GTK_WIDGET_CLASS (parent_class)->unrealize)		(*GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);}