[vtkusers] QT/VTK application: Access violation on vtkTransform inside a QTimer event

John Drescher drescherjm at gmail.com
Tue Nov 8 09:49:37 EST 2011


On Tue, Nov 8, 2011 at 9:39 AM, Elvis Chen <elvis.chen at gmail.com> wrote:
> hi all,
> I'm writing an application base on QT/VTK, using 3D positional tracking
> system.  The pose of an tracked object is returned as a vtkTransform, and it
> is obtained using a QTimer event.  The timing interval is set at 0, thus it
> is updating the vtkTransform continuously (or as fast as the
> computer/tracking system can).
> The vtkTransform is defined as an class object and it would be accessed by
> other class members.  However, I noticed that sometimes wI would get an
> access violation error:
>
> First-chance exception at 0x60c48183 (vtkCommon.dll) in my.exe: 0xC0000005:
> Access violation reading location 0xfeeeff36.
> Unhandled exception at 0x60c48183 (vtkCommon.dll) in my.exe: 0xC0000005:
> Access violation reading location 0xfeeeff36.
> The program '[5788] my.exe: Native' has exited with code -1073741819
> (0xc0000005).
> and the place where the access violation occurs is in
> vtkAbstractTransform::GetMTime
>     unsigned long inverseMTime = this->MyInverse->GetMTime();
> which is being updated in the QTimer event.
>
> What would be proper mechanism to prevent such access violation?
> any help is very much appreciated,

Looks like you are using a pointer that has had its memory released.
0xfeee is the clue.

John



More information about the vtkusers mailing list