Skip to content

Commit

Permalink
Fix crash in H5J HDF loader
Browse files Browse the repository at this point in the history
This function allocated a H5:Group but never deleted it, which should result in a memory leak. But recent changes caused this to manifest as a crash that occurs in the finalization code of the C++ main.
  • Loading branch information
Mark Bolstad committed Feb 5, 2018
1 parent 65a7865 commit 5fa6320
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions v3d_main/neuron_annotator/utility/loadV3dFFMpeg.cpp
Expand Up @@ -125,8 +125,8 @@ bool saveStackHDF5( const char* fileName, const My4DImage& img, Codec_Mapping* m
{
#ifdef USE_HDF5
H5::Exception::dontPrint();
H5::H5File file( fileName, H5F_ACC_TRUNC );
H5::Group* group = new H5::Group( file.createGroup( "/Channels" ) );
H5::H5File* file = new H5::H5File( fileName, H5F_ACC_TRUNC );
H5::Group* group = new H5::Group( file->createGroup( "/Channels" ) );

Image4DProxy<My4DImage> proxy( const_cast<My4DImage*>( &img ) );

Expand Down Expand Up @@ -225,7 +225,8 @@ std: stringstream name;
if ( !mapping )
delete imap;

file.close();
delete group;
delete file;

return true;
}
Expand Down

0 comments on commit 5fa6320

Please sign in to comment.