Commit 47a2e1af authored by David Gobbi's avatar David Gobbi
Browse files

ERR: print/Print under Python/Tcl was causing occasional segfaults

     under Linux/gcc-3.1 (perhaps other platforms too?), this has
     probably been the case since the strstream changes.  Unfreezing
     instead of deleting seems to fix.
parent d738ab09
......@@ -109,7 +109,7 @@ static PyObject *PyVTKObject_PyString(PyVTKObject *self)
self->vtk_ptr->Print(buf);
buf.put('\0');
PyObject *res = PyString_FromString(buf.str());
delete buf.str();
buf.freeze(0);
return res;
}
......
......@@ -672,7 +672,7 @@ void vtkParseOutput(FILE *fp, FileInfo *data)
fprintf(fp," op->Print(buf);\n");
fprintf(fp," buf.put('\\0');\n");
fprintf(fp," Tcl_SetResult(interp,buf.str(),TCL_VOLATILE);\n");
fprintf(fp," delete buf.str();\n");
fprintf(fp," buf.freeze(0);\n");
fprintf(fp," return TCL_OK;\n }\n");
/* Add the PrintRevisions method to vtkObjectBase. */
fprintf(fp," if ((!strcmp(\"PrintRevisions\",argv[1]))&&(argc == 2))\n {\n");
......@@ -680,7 +680,7 @@ void vtkParseOutput(FILE *fp, FileInfo *data)
fprintf(fp," op->PrintRevisions(buf);\n");
fprintf(fp," buf.put('\\0');\n");
fprintf(fp," Tcl_SetResult(interp,buf.str(),TCL_VOLATILE);\n");
fprintf(fp," delete buf.str();\n");
fprintf(fp," buf.freeze(0);\n");
fprintf(fp," return TCL_OK;\n }\n");
}
/* Add the AddObserver method to vtkObject. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment