[Insight-users] destruction of smart pointers

John Biddiscombe John Biddiscombe" <jbiddiscombe@skippingmouse.co.uk
Sun, 16 Feb 2003 20:22:41 -0000


Dean,

Apologies, I got totally muddled up about the ::pointer business - I somehow
assumed you were assigning an instance of the importer in the form's header
(despite the fact that you weren't!)
Since I misunderstood you the first time and comfused myself the second, why
not send me a simple form+project that is causing trouble.

> There is no pointer destruction problem when declaring an itk object
within the form's constructor and then increasing the reference count by one
to force its persistence beyond the scope of
> the constructor.  However, I would have to create a lot of callback type
code so that using the name of
> the pointer is avoided elseware in the app.

I see. yes it needs to be declared in the header and created in the
constructor giving you access to it throughout the lifetime of the form

> Have you tried any tests with itk & Borland GUI app's that work?
No. ITK won't compile with BCB 6 and I use VC7 for this stuff. Please send a
form though so I can see exactly what you've done. BCB is no different from
any other C++ compiler in the respect of constructors and destructors so
what works in the example guis, should work for BCB too.

JB