[vtk-developers] interesting problem with vtkObject Update() [FIX + PATCH, please apply]

Lisa Avila lisa.avila at kitware.com
Wed Feb 19 17:41:10 EST 2003


Hi Charl,

This looks like a good fix  - but I say that hesitantly since I always fear 
changing in the pipeline behavior :-)

It is still dangerous to run the event loop in the middle of processing an 
event - what if some queued event caused the object you are updating to be 
deleted? But the same problem could occur if the StartEvent caused the 
bounds of some resulting data to be computed (which would cause a recursive 
update without requiring any GUI) so your fix seems good for this. Of 
course, this is just a band-aid on a much larger problem - it is quite easy 
to put things in the observers that causes crashes if you are not careful.

Lisa

At 04:55 PM 2/19/2003, Charl P. Botha wrote:
>Dear developers,
>
>On Wed, Feb 19, 2003 at 04:59:14PM +0100, Charl P. Botha wrote:
> > I ran into this problem whilst developing such a GUI + VTK application.  My
> > questions are:
> >
> > 1. Can this be considered a bug?
> > 2. Is there a way to lock the Update() method of a vtkObject?  This 
> would of
> >    course solve the problem above.
>
>I believe that this DOES constitute a bug (a very serious one that affects
>all descendants of vtkSource) and therefore I've attached my fix. The
>UpdateData() method in the vtkSource class IS protected with an "Updating"
>variable, but it gets reset too soon, which means the previously attached
>deciFran.py example will always segfault.
>
>I've attached my fix, which moves the "Updating" reset to the END of the
>method.  I believe this is correct, as UpdateData() was never supposed to be
>fully re-entrant.
>
>Please apply before the new release if at all possible.
>
>Thanks,
>Charl
>
>--
>charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/






More information about the vtk-developers mailing list