Browse Source

protect from string destruction

rdb 15 years ago
parent
commit
c5f2020858
1 changed files with 2 additions and 1 deletions
  1. 2 1
      panda/src/glstuff/glShaderContext_src.cxx

+ 2 - 1
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;