diff --git a/tests/examples/gtk/fxtest/fxtest.c b/tests/examples/gtk/fxtest/fxtest.c index 9b7336120c..aedb0a037f 100644 --- a/tests/examples/gtk/fxtest/fxtest.c +++ b/tests/examples/gtk/fxtest/fxtest.c @@ -6,8 +6,6 @@ #include -GstElement *pipeline; - /* TODO: use x overlay in the proper way (like suggested in docs, see gtkxoverlay example) */ static gboolean expose_cb (GtkWidget * widget, GdkEventExpose * event, gpointer data) @@ -20,7 +18,7 @@ expose_cb (GtkWidget * widget, GdkEventExpose * event, gpointer data) } static void -destroy_cb (gpointer data) +destroy_cb (GtkWidget *widget, GdkEvent *event, GstElement *pipeline) { g_message ("destroy callback"); @@ -86,6 +84,7 @@ gint main (gint argc, gchar * argv[]) { GstStateChangeReturn ret; + GstElement *pipeline; GstElement *uload, *filter, *sink; GstElement *sourcebin; GError *error = NULL; @@ -139,11 +138,6 @@ main (gint argc, gchar * argv[]) window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (window), 3); - g_signal_connect (G_OBJECT (window), "delete-event", - G_CALLBACK (destroy_cb), NULL); - g_signal_connect (G_OBJECT (window), "destroy-event", - G_CALLBACK (destroy_cb), NULL); - pipeline = gst_pipeline_new ("pipeline"); uload = gst_element_factory_make ("glupload", "glu"); @@ -157,6 +151,11 @@ main (gint argc, gchar * argv[]) return -1; } + g_signal_connect (G_OBJECT (window), "delete-event", + G_CALLBACK (destroy_cb), pipeline); + g_signal_connect (G_OBJECT (window), "destroy-event", + G_CALLBACK (destroy_cb), pipeline); + screen = gtk_drawing_area_new (); gtk_widget_set_size_request (screen, 640, 480); // 500 x 376