From 0208b083bf0000ce6ecca832399a986b37d88501 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 20 Feb 2009 08:03:27 -0500 Subject: [PATCH] Fixed cleanup of Conditionals in pop_source(). --- mojoshader_preprocessor.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mojoshader_preprocessor.c b/mojoshader_preprocessor.c index 47d0f33c..05a8d083 100644 --- a/mojoshader_preprocessor.c +++ b/mojoshader_preprocessor.c @@ -588,8 +588,13 @@ static void pop_source(Context *ctx) // 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);