[Insight-developers] changes to ProcessObject
M.Staring at lumc.nl
M.Staring at lumc.nl
Tue May 29 08:35:45 EDT 2012
Hi all, Gaetan,
This commit:
http://itk.org/gitweb?p=ITK.git;a=commitdiff;h=322cb3952a45cbdb4a100a3d308769a6027d4f95
changed the function ProcessObject::UpdateOutputData. Notably a try-catch was changed from
try
{
this->GenerateData();
}
catch( ProcessAborted & excp )
{
this->InvokeEvent( AbortEvent() );
this->ResetPipeline();
this->RestoreInputReleaseDataFlags();
throw excp;
}
catch( ExceptionObject& excp )
{
this->ResetPipeline();
this->RestoreInputReleaseDataFlags();
throw excp;
}
to
try
{
this->GenerateData();
}
catch ( ProcessAborted & excp )
{
this->InvokeEvent( AbortEvent() );
this->ResetPipeline();
this->RestoreInputReleaseDataFlags();
throw excp;
}
catch (...)
{
this->ResetPipeline();
this->RestoreInputReleaseDataFlags();
throw;
}
So itk::ExceptionObject is not explicitely caught anymore.
In my code I depend on itk::ExceptionObject to be caught and re-thrown. I catch it again higher up, and do something with it (not just stopping the program). With this change the original throw (itkExceptionMacro) ends up in catch(...) and just "throw" is called instead of "throw excp". Is it possible to add an extra catch:
try
{
this->GenerateData();
}
catch ( ProcessAborted & excp )
{
this->InvokeEvent( AbortEvent() );
this->ResetPipeline();
this->RestoreInputReleaseDataFlags();
throw excp;
}
catch( ExceptionObject & excp )
{
this->ResetPipeline();
this->RestoreInputReleaseDataFlags();
throw excp;
}
catch (...)
{
this->ResetPipeline();
this->RestoreInputReleaseDataFlags();
throw;
}
?
which would restore the original working of my code.
Regards, Marius
Marius Staring, PhD
Division of Image Processing (LKEB)
Department of Radiology
Leiden University Medical Center
PO Box 9600, 2300 RC Leiden, The Netherlands
phone: +31 (0)71 526 2137, fax: +31 (0)71 524 8256
m.staring at lumc.nl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20120529/8c8f798a/attachment.htm>
More information about the Insight-developers
mailing list