-RM-177-MR-NIfTI reader resource leak and exception slicing problem
Hi,
In the WReaderNIfTI::load, the header variable contains a nifti_image which isn't freed properly and thus leaked. Also, exceptions are handled like this: @catch( const std::exception& e ) { nifti_image_free( filedata ); throw e; }@
This causes the exception to be sliced if a subclass of std::exception is thrown.
The attached patch fixes both of these problems. The header variable isn't actually needed as far as I can see and the exception can be handled more easily by using a boost::shared_ptr.
(from redmine: created on 2012-05-23, closed on 2012-05-24)