test-shader: Unref the ClutterShader after setting it on an actor
authorNeil Roberts <neil@linux.intel.com>
Thu, 22 Jul 2010 16:27:04 +0000 (17:27 +0100)
committerNeil Roberts <neil@linux.intel.com>
Thu, 22 Jul 2010 20:51:47 +0000 (21:51 +0100)
Otherwise the test leaks the shader object and the underlying GLSL
program.

tests/interactive/test-shader.c

index e997b7a..c008e79 100644 (file)
@@ -277,6 +277,8 @@ set_shader_num (ClutterActor *actor, gint new_no)
                                                    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_position (actor, 100, 100);
 
+  g_object_unref (shader);
+
   clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor);
 
   clutter_actor_set_shader_param_int (actor, "tex", 0);