Closed GoogleCodeExporter closed 8 years ago
HDF5 1.8.9
Original comment by Bo.Schwa...@gmail.com
on 13 Mar 2014 at 3:13
Do you really mean you can't store IArchive as a global variable?
If it is try putting H5dont_atexit():
http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-DontAtExit
In your custom tool, this should prevent the unwinding issues you are seeing.
Original comment by miller.lucas
on 13 Mar 2014 at 3:24
Hi Lucas
Let me show you the issue.
Very easy, I have a PRMAN procedural, and I don't want to open the archive file
to read the file once to read single object during the rendering (maybe a lot
of objects), so that I will open the archive and store it into a global map.
static std::map< std::string , ArchiveRef > g_allIArchives ;
class Archive
{
public :
Archive()
{
}
~Archive()
{
}
bool ReadFile( const std::string & filePath ) ;
bool ReadObject( const ReadOptions & ReadOptions ) ;
private :
Alembic::Abc::IArchive m_iArchive ;
} ;
bool Archive::ReadFile( const std::string & filePath )
{
try
{
Alembic::AbcCoreFactory::IFactory iFactory ;
Alembic::Abc::IArchive iArchive = iFactory.getArchive( filePath ) ;
if ( ! iArchive.valid() )
{
return false ;
}
m_iArchive = iArchive ; // THIS LINE
}
catch ( const std::exception & e )
{
std::cerr << e.what() << std::endl ;
return false ;
}
catch ( ... )
{
return false ;
}
return true ;
}
I'm sure this problem once I commented out that line, the procedural exited
properly without any error but once I want to store that archive, exception
raised. Ogawa don't have this issue, so I have converted the all files into
Ogawa format. Any ideas ? Thanks !
Original comment by Bo.Schwa...@gmail.com
on 13 Mar 2014 at 3:32
Yeah since g_allIArchives is a static global, you will need to call
H5dont_at_exit() once.
Original comment by miller.lucas
on 13 Mar 2014 at 3:41
Seems fine now.
Original comment by Bo.Schwa...@gmail.com
on 20 Mar 2014 at 2:42
Original comment by miller.lucas
on 20 Mar 2014 at 5:10
Original issue reported on code.google.com by
Bo.Schwa...@gmail.com
on 13 Mar 2014 at 3:13