Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • VTK VTK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 833
    • Issues 833
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 236
    • Merge requests 236
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTKVTK
  • VTKVTK
  • Issues
  • #367
Closed
Open
Issue created Nov 11, 2003 by Kitware Robot@kwrobotOwner

Small Bug in vtkSetStringMacro

This issue was created automatically from an original Mantis Issue. Further discussion may take place here.


In the vtkSetStringMacro there seems to be a small Bug.

When the Debug flag is on the argument _arg will be sent to the ostream. This is not bad until the macro is beeing called with _arg == NULL. This seems to be the case i.e. in the destructor of vtkXMLWriter.

The following is from Common/vtkSetGet.h :

#define vtkSetStringMacro(name)
virtual void Set##name (const char* _arg)
{
vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting " << #name " to " << _arg );
if ( this->name == NULL && _arg == NULL) { return;}
if ( this->name && _arg && (!strcmp(this->name,_arg))) { return;}
if (this->name) { delete [] this->name; }
if (_arg)
{
this->name = new char[strlen(_arg)+1];
strcpy(this->name,_arg);
}
else
{
this->name = NULL;
}
this->Modified();
}

Best regards, Roland

Assignee
Assign to
Time tracking