Skip to content

GitLab

  • Menu
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 740
    • Issues 740
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 195
    • Merge requests 195
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & 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
  • VTK
  • VTKVTK
  • Issues
  • #18354
Closed
Open
Created Oct 26, 2021 by Jose Luis Cercos-Pita@sanguinariojoeContributor

vtkObject::RemoveObserver from vtkCommand::Execute would crash

If during a vtkCommand::Execute you call vtkObject::RemoveObserver(vtkCommand*) to remove an observer (with some other vtkCommand), it would corrupt the linked list (see vtkSubjectHelper in vtkObject.cxx) and crash.

I did not checked any other vtkObject::RemoveObserver/vtkObject::RemoveObservers function, but I expect the same behavior.

I really think this shall be fixed, although adding a warning to the documentation would be also acceptable.

If you decide to fix it, I suggest adding "a new event" called vtkCommand::DeleteObserverEvent, in such a way that vtkObject::RemoveObserver is not actually removing the observer, but binding it to such event. The next time vtkSubjectHelper::InvokeEvent is called, it will be safe to remove those observers at the end of the function. I can do that by myself and submit a PR, just let me know!

Assignee
Assign to
Time tracking