mojoshader_preprocessor.c
changeset 677 75e28bb57b2d
parent 676 29447167fc68
child 678 9fa2eb7d7871
--- a/mojoshader_preprocessor.c	Fri Feb 20 01:15:44 2009 -0500
+++ b/mojoshader_preprocessor.c	Fri Feb 20 08:03:27 2009 -0500
@@ -588,8 +588,13 @@
 
     // state->filename is a pointer to the filename cache; don't free it here!
 
-    while (state->conditional_stack)
-        put_conditional(ctx, state->conditional_stack);
+    Conditional *cond = state->conditional_stack;
+    while (cond)
+    {
+        Conditional *next = cond->next;
+        put_conditional(ctx, cond);
+        cond = next;
+    } // while
 
     ctx->include_stack = state->next;
     put_include(ctx, state);