[vtk-developers] Use of autorelease in Cocoa classes

Sean McBride sean at rogue-research.com
Fri Feb 8 17:08:59 EST 2013


On Wed, 6 Feb 2013 10:10:32 -0500, Berk Geveci said:

>Thanks guys. I am traveling now and won't be able to play with this
>until next week. When I am back, I can go over it again with
>Instruments to see if things are resolved.

No point in trying yet, your issue is not fixed.  I'm starting by trying to get my old SimpleCocoaVTK example running again, and I now have it compiling and linking, but I get a weird crash at runtime.

Basically, the ::New() of some VTK objects is failing.  For example, this returns a seemingly reasonable object:

	auto foo = vtkSmartPointer<vtkTransform>::New();

But

 auto bar = vtkRenderWindowInteractor::New();

dies here dereferencing null because vtkPolyDataMapper::New() return NULL:

vtkInteractorStyle::vtkInteractorStyle()
vtkInteractorStyleSwitchBase::vtkInteractorStyleSwitchBase()
vtkInteractorStyleSwitchBase::vtkInteractorStyleSwitchBase()
vtkInteractorStyleSwitchBase::New()
vtkRenderWindowInteractor::vtkRenderWindowInteractor()
vtkRenderWindowInteractor::vtkRenderWindowInteractor()
vtkRenderWindowInteractor::New()

I wonder if it has anything to do with the factory system and there being a Cocoa subclass of vtkRenderWindowInteractor, and that some code is not linked somehow...

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtk-developers mailing list