[Insight-users] Releasing a FileReader releases the PixelContainer of already-read images?

Zachary Pincus zpincus at stanford.edu
Tue Jan 17 04:09:20 EST 2006


> Sounds ok to me to use a typemap to do this for all objects. But  
> this might make the Python syntax deviate from the C++ syntax. Is  
> that good ? Its just like in C++ you would say.
>
> foo::Pointer  f = ...    ===== f =  foo_Pointer( ... )
>
> instead of
>
> foo * f = ...                 =====  f =...

I think it's good for the Python syntax to deviate from the C++  
insofar as python is not C++. Specifically, anytime a python object  
has any references to it, that object's memory should never be  
released. Having live python objects which are just raw pointers and  
not smart pointers violates this contract, and should be eschewed  
whenever possible, IMO, even at the cost of making the code look a  
bit different than it would under C++.

Zach


More information about the Insight-users mailing list