test-shader: Unref the ClutterShader after setting it on an actor
Otherwise the test leaks the shader object and the underlying GLSL program.
This commit is contained in:
parent
a639ed6593
commit
616eccdad6
@ -277,6 +277,8 @@ set_shader_num (ClutterActor *actor, gint new_no)
|
|||||||
1.0f / tex_height);
|
1.0f / tex_height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_object_unref (shader);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,6 +404,8 @@ test_shader_main (gint argc, gchar *argv[])
|
|||||||
clutter_actor_set_shader (actor, shader);
|
clutter_actor_set_shader (actor, shader);
|
||||||
clutter_actor_set_position (actor, 100, 100);
|
clutter_actor_set_position (actor, 100, 100);
|
||||||
|
|
||||||
|
g_object_unref (shader);
|
||||||
|
|
||||||
clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor);
|
clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor);
|
||||||
|
|
||||||
clutter_actor_set_shader_param_int (actor, "tex", 0);
|
clutter_actor_set_shader_param_int (actor, "tex", 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user