glsl2: Clear out profile pointers in _mesa_glsl_release_functions
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 9 Sep 2010 00:13:00 +0000 (17:13 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 9 Sep 2010 00:16:49 +0000 (17:16 -0700)
Otherwise builtin_profiles contains dangling pointers the next time
_mesa_read_profile is called.  I suspect this may fix bugzilla #29847,
but I was never able to reproduce it.

src/glsl/builtin_function.cpp
src/glsl/builtins/tools/generate_builtins.py

index 0a2b0120f26e30bd648c5223bb2d704e6b6e729d..944265ca945ce3511abf9e04bc2f67f6ca2f67f8 100644 (file)
@@ -19143,6 +19143,7 @@ _mesa_glsl_release_functions(void)
 {
    talloc_free(builtin_mem_ctx);
    builtin_mem_ctx = NULL;
+   memset(builtin_profiles, 0, sizeof(builtin_profiles));
 }
 
 static void
index 2431096a2b5fcf49285b7ef7d788f826e37738bb..f96a5f7b8bb4dc5ac17b6478a2116a8167f51067 100755 (executable)
@@ -182,6 +182,7 @@ _mesa_glsl_release_functions(void)
 {
    talloc_free(builtin_mem_ctx);
    builtin_mem_ctx = NULL;
+   memset(builtin_profiles, 0, sizeof(builtin_profiles));
 }
 
 static void