GLShaderContext mixing malloc and delete
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Panda3D |
Fix Released
|
Undecided
|
rdb |
Bug Description
GLShaderContext
Python(
Also the info_log pointer is uninitialized and is deleted even if not allocated, so we may delete a random pointer.
So this patch uses free() instead of delete[]. Also it only frees the buffer if it was allocated. And I changed the length check to >1 - the length returned for GL_INFO_LOG_LENGTH includes the NUL char, so length of 1 would mean an empty string (and this is what my Nvidia Quadro FX 580 on Ubuntu 11.10 always returns on success).
Changed in panda3d: | |
status: | Fix Committed → Fix Released |
Thank you very much for the patch. I've applied it to the trunk and 1.8 branch. I've applied the same fix to the glsl_report_ program_ errors( ) method as well.