test-texture-fbo: Disconnect the paint handler for the stage

Otherwise the paint handler will still be run for the subsequent
tests. This ends up writing to the ‘state’ variable which used to be
on the stack so it will end up corrupting some stack variable. This
was causing test-cogl-premult to fail.
This commit is contained in:
Neil Roberts 2010-01-18 12:42:20 +00:00
parent ce030a3fce
commit ff1d9cf090

View File

@ -180,6 +180,7 @@ test_texture_fbo (TestConformSimpleFixture *fixture,
{ {
TestState state; TestState state;
guint idle_source; guint idle_source;
gulong paint_handler;
ClutterActor *actor; ClutterActor *actor;
int ypos = 0; int ypos = 0;
@ -236,12 +237,15 @@ test_texture_fbo (TestConformSimpleFixture *fixture,
* will trigger redrawing. */ * will trigger redrawing. */
idle_source = g_idle_add (queue_redraw, state.stage); idle_source = g_idle_add (queue_redraw, state.stage);
g_signal_connect_after (state.stage, "paint", G_CALLBACK (on_paint), &state); paint_handler = g_signal_connect_after (state.stage, "paint",
G_CALLBACK (on_paint), &state);
clutter_actor_show_all (state.stage); clutter_actor_show_all (state.stage);
clutter_main (); clutter_main ();
g_signal_handler_disconnect (state.stage, paint_handler);
g_source_remove (idle_source); g_source_remove (idle_source);
/* Remove all of the actors from the stage */ /* Remove all of the actors from the stage */