Skip to content

Commit

Permalink
Protect late destructor call to FileSystem
Browse files Browse the repository at this point in the history
ROOT indirectly binds the destruction of a FileSystem to a the global
gROOT. This can lead to the ForkHandler being deleted before the
FileSystem is deleted.
  • Loading branch information
Dr15Jones committed Oct 16, 2014
1 parent 7ed10c7 commit 258e689
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/XrdCl/XrdClFileSystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,11 @@ namespace XrdCl
//----------------------------------------------------------------------------
FileSystem::~FileSystem()
{
if( !pPlugIn )
DefaultEnv::GetForkHandler()->UnRegisterFileSystemObject( this );
if( !pPlugIn ) {
ForkHandler* handler = DefaultEnv::GetForkHandler();
if( handler )
handler->UnRegisterFileSystemObject( this );
}
delete pUrl;
delete pPlugIn;
}
Expand Down

0 comments on commit 258e689

Please sign in to comment.