glsl: added slang_operation_free_children()
authorBrian Paul <brianp@vmware.com>
Wed, 24 Jun 2009 22:04:33 +0000 (16:04 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 26 Jun 2009 19:16:33 +0000 (13:16 -0600)
src/mesa/shader/slang/slang_compile_operation.c
src/mesa/shader/slang/slang_compile_operation.h

index b75fd073afdf17ae2f841b78826b5dbdbe5b8b9a..48586c2d96d1cb7a544a156659de43cbc4128319 100644 (file)
@@ -200,6 +200,20 @@ slang_operation_delete(slang_operation *oper)
 }
 
 
+void
+slang_operation_free_children(slang_operation *oper)
+{
+   GLuint i;
+   for (i = 0; i < slang_oper_num_children(oper); i++) {
+      slang_operation *child = slang_oper_child(oper, i);
+      slang_operation_destruct(child);
+   }
+   _slang_free(oper->children);
+   oper->children = NULL;
+   oper->num_children = 0;
+}
+
+
 slang_operation *
 slang_operation_grow(GLuint *numChildren, slang_operation **children)
 {
index 06b452d3d9cfce41e5cb7d3333893aadcf5f8307..d75965c2355e0910bb782f5245a4b12ab913c521 100644 (file)
@@ -150,6 +150,9 @@ slang_operation_new(GLuint count);
 extern void
 slang_operation_delete(slang_operation *oper);
 
+extern void
+slang_operation_free_children(slang_operation *oper);
+
 extern slang_operation *
 slang_operation_grow(GLuint *numChildren, slang_operation **children);