//
// Initial testcase for bug #535295
//
// This doesn't crash consistenly. But, compile and execute with this:
//
// 	gcc crash-test.c -std=c99 `pkg-config --libs --cflags gthread-2.0 gtk+-2.0` \
// 		-o crash-test && for i in $(seq 1 100); do ./crash-test; done
//
// and on my system (ubuntu hardy) this produces a bunch of:
// 
// 	GLib-GObject-ERROR **: g_type_plugin_*() invalidly modified type `GFileInfo'
//	aborting...
//	Aborted
//	
// and some other random errors now and then for good measure.
// 
// Sam Thursfield
// 

#include <gtk/gtk.h>

int main(int argc, char **argv) {
	// Comment out this line and the crashing stops.
	g_thread_init(NULL);

	gtk_init(&argc, &argv);

	GtkBuilder *builder=gtk_builder_new();
	GError *error=NULL;
	gtk_builder_add_from_string(builder, 
		"<interface><object class=\"GtkFileChooserWidget\" id=\"play_dir_location\">"
		"<property name=\"visible\">True</property>"
		"<property name=\"action\">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property></object></interface>",
-1, &error);	
	g_object_unref(builder);
	return 0;	
};
