[Insight-developers] LightObject Destructor and Exception Safety

kent williams norman-k-williams at uiowa.edu
Wed Apr 4 16:46:49 EDT 2007


I've actually seen this exception thrown a few times and it seems like when
I was new to ITK, I created an automatic instance of a descendent class of
itk::LightProcessObject.  I don't remember which class, though -- most of
the commonly used ITK classes have protected constructors.

I also saw this once as the result (I believe) of a gcc compiler bug in a
function returning a smart pointer, but I don't remember the circumstances
there either.

At any rate, a properly written program would never throw this exception.  I
seem to write incorrect programs and then turn them into correct ones as my
SOP.

On 4/4/07 2:57 PM, "Brad King" <brad.king at kitware.com> wrote:

> Bill Lorensen wrote:
>> Has this exception ever been thrown? If not, then we can:
>> 
>> 1) remove the test
>> 2) issue a warning
>> 3) leave it there with a comment
> 
> I've never seen it but I haven't messed with reference counts too much.
>  I think the SmartPointer keeps things pretty safe.  Since there is
> something wrong with a program that would produce the error anyway I
> think printing a message is okay.  I'll change it to use itkWarningMacro
> and we can change it to something else if others prefer.
> 
> -Brad
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers



More information about the Insight-developers mailing list