diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 5a5437b764..dc679fc433 100755 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -1032,7 +1032,8 @@ glsl_compile_entry_point(GSG *gsg, Shader::ShaderType type) { if (!handle) { return 0; } - const char* text = _shader->get_text(type).c_str(); + string text_str = _shader->get_text(type); + const char* text = text_str.c_str(); gsg->_glShaderSource(handle, 1, &text, NULL); gsg->_glCompileShader(handle); GLint status;