passing pointers to VTK-classes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

passing pointers to VTK-classes

Jens-3-3
Hi
Can I be sure that all functions of VTK-classes requesting a "const char*" or
a "char*" are NOT saving the pointers adress but copying the string to there
own memory?
I wonder what happens if I pass a "const char*"/"char*" to any VTK-class and  
free that "const char*"/"char*" afterwards.
How long do I have to make sure that a pointer I passed to a VTK-class stays
valid?

        Greetings
                Jens

P.S:
I know that I do not have to worry about passing pointers of VTK-classes if I
use "Delete()" instead of "delete".
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: passing pointers to VTK-classes

Jens-3-3
I had a look at vtkSetGet.h and it seems as if I do not have to worry.

Am Freitag, 20. Januar 2006 09:20 schrieb Jens G.:

> Hi
> Can I be sure that all functions of VTK-classes requesting a "const char*"
> or a "char*" are NOT saving the pointers adress but copying the string to
> there own memory?
> I wonder what happens if I pass a "const char*"/"char*" to any VTK-class
> and free that "const char*"/"char*" afterwards.
> How long do I have to make sure that a pointer I passed to a VTK-class
> stays valid?
>
> Greetings
> Jens
>
> P.S:
> I know that I do not have to worry about passing pointers of VTK-classes if
> I use "Delete()" instead of "delete".
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers