I have some code that looks like this, similar to some of the samples:
void main() {
bool use_glut=true;
...
if(use_glut) {
// Path 1
sutilDisplayBufferInGlutWindow(...);
} else {
// Path 2
sutilDisplayFilePPM(...);
}
cout << "done" << endl;
}
Whether I take path 1 or path 2, I reach “done” and see the expected output (either a glut window or a .ppm image file created). However, on path 2, at program exit I see a glibc sigdump complaining of “double free or corruption”. It’s likely my code has a bug in it, but why would Path 2 exhibit this and not Path 1?