/* gcc -g -O2 -Wall `pkg-config --cflags --libs libgtkhtml-4.0` leak.c -o leak && ./leak */

#include <glib.h>
#include <gtkhtml/gtkhtml.h>

int main(int argc, char *argv[])
{
	GtkWidget *html;
	GdkColor *color = NULL;
	GtkStyleContext *style_context;
	GdkRGBA rgba;
	gint ii;
	const gchar *names[] = {
		"link_color",
		"alink_color",
		"vlink_color",
		"spell_error_color",
		"cite_color",
		NULL
	};

	gtk_init (&argc, &argv);

	html = gtk_html_new ();

	for (ii = 0; names[ii]; ii++) {
		style_context = gtk_widget_get_style_context (html);

		gtk_widget_style_get (html, names[ii], &color, NULL);

		printf ("%s: found color:%p\n", __FUNCTION__, color);
		if (color) {
			gdk_color_free (color);
			color = NULL;
			continue;
		}

		gtk_style_context_get_color (style_context, GTK_STATE_FLAG_NORMAL, &rgba);
	}

	gtk_widget_destroy (html);

	return 0;
}
