mojoshader_compiler.c
changeset 936 b4a15ef390c4
parent 935 bef902f8b4d9
child 937 94e50ba3f956
--- a/mojoshader_compiler.c	Tue Nov 02 02:17:58 2010 -0400
+++ b/mojoshader_compiler.c	Tue Nov 02 14:55:10 2010 -0400
@@ -2365,7 +2365,7 @@
 
 
 static MOJOSHADER_astData MOJOSHADER_out_of_mem_ast_data = {
-    1, &MOJOSHADER_out_of_mem_error, 0, 0, 0, 0, 0
+    1, &MOJOSHADER_out_of_mem_error, 0, 0, 0, 0, 0, 0
 };
 
 // !!! FIXME: cut and paste from assembler.
@@ -2459,6 +2459,9 @@
     retval->free = (ctx->free == MOJOSHADER_internal_free) ? NULL : ctx->free;
     retval->malloc_data = ctx->malloc_data;
 
+    retval->strcache = ctx->strcache;
+    ctx->strcache = NULL;
+
     return retval;
 } // build_astdata
 
@@ -2665,6 +2668,9 @@
                     (MOJOSHADER_astCompilationUnit *) &data->ast->compunit);
     } // if
 
+    if (data->strcache != NULL)
+        stringcache_destroy((StringCache *) data->strcache);
+
     f(data, d);
 } // MOJOSHADER_freeAstData