[vtkusers] vtkImagePlaneWidget crashes after a second load of data

Dean Inglis dean.inglis at sympatico.ca
Fri Jul 27 09:07:13 EDT 2007


Hi Flo,

vtkImagePlaneWidget does not use reference counting
when you set the input image data: it maintains a
pointer to the input, so that if what the pointer
points to changes (in terms of memory) you can get
an access violation or a crash.  What you can do
to work around this is to turn off the widget BEFORE
you load your data, set it's input to NULL, then
load your new data and turn the widget back on.

Dean




Dear all:
after few hours of work I found that the problem is related to my  
RenderWindowInteractor affected to the vtkImagePlaneWidget . In fact,  
if I create two different windows with two separate  
RenderWindowInteractor and if I change the RenderWindowInteractor  
while loading the second data set, everything is fine.

However, I still don't know what is wrong as, while reloading, I  
clean ever actors and volume in the renderwindow ---
I'm wondering is there is not a leak/undeleted reference to the iren  
in the vtkImagePlaneWidget code .... Any help is appreciated !

Flo.

On 25-Jul-07, at 10:39 PM, Flo wrote:

> Dear all:
>
> I use vtkImagePlaneWidget in my application with the original code.
> Using it while loading a dataset is fine.
> However, while, in the same application sequence, I re-load a  
> second set of data, as soon as I click or interact with any of the  
> plane I have a crash. However, interacting with the renderer  
> (outside the ImagePlane outline but inside the renderwindow,  
> meaning zooming and rotation) is fine.
>
> Any idea where this kind of crash my come from ?
>
> regards,
> Flo.



More information about the vtkusers mailing list