[vtkusers] Dispose to vtk objects

Benjamin Jähn jaminus_jahnatos at freenet.de
Tue Aug 6 09:33:43 EDT 2013


Hi all,

is there somewhere a documentation about such issues? I have read in the 
newsgroup somewhere that it is necessary to hold a managed reference to 
each object one pass to the "native" vtk as long as it is used.

Regards,
Benjamin

Am 11.06.2013 16:45, schrieb David Cole:
>> I saw in some example that after exit dispose of
>> all the objects is performed.
>> Is this a must? I'm talking about Activiz wrapping,
>> isn't it performed automatically?
>
>
> Hi Max,
>
> You are correct, it is performed automatically whenever the .NET 
> garbage collector runs.
>
> However, some sequences of code produce networks of connected objects 
> which must be broken down, disconnected and destroyed in a 
> deterministic manner. Many times, objects that are related to the 
> RenderWindow in some way should be properly removed from the 
> RenderWindow before the window is closed or destroyed.
>
> It's moderately frequent in writing VTK code that you'll need to 
> actively manage some of the objects with "early" calls to Dispose. As 
> soon as you do
> call Dispose, though, you should immediately set the associated 
> variable to null as well, to remove the .NET reference hold on it.
>
> ( Speaking of Activiz, have you seen the Kickstarter campaign to 
> update it? It only has minutes left to go... 
> http://www.kickstarter.com/projects/dlrdave/activiz-net-installers-featuring-vtk-510 
> )
>
>
> HTH,
> David
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: 
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list