nfs4: FileSystem::~FileSystem() make sure fServer is valid
This commit is contained in:
@@ -30,6 +30,7 @@ FileSystem::FileSystem(const MountConfiguration& configuration)
|
|||||||
fNamedAttrs(true),
|
fNamedAttrs(true),
|
||||||
fPath(NULL),
|
fPath(NULL),
|
||||||
fRoot(NULL),
|
fRoot(NULL),
|
||||||
|
fServer(NULL),
|
||||||
fId(1),
|
fId(1),
|
||||||
fConfiguration(configuration)
|
fConfiguration(configuration)
|
||||||
{
|
{
|
||||||
@@ -44,9 +45,12 @@ FileSystem::FileSystem(const MountConfiguration& configuration)
|
|||||||
|
|
||||||
FileSystem::~FileSystem()
|
FileSystem::~FileSystem()
|
||||||
{
|
{
|
||||||
NFS4Server* server = reinterpret_cast<NFS4Server*>(fServer->PrivateData());
|
if (fServer != NULL) {
|
||||||
if (server != NULL)
|
NFS4Server* server
|
||||||
server->RemoveFileSystem(this);
|
= reinterpret_cast<NFS4Server*>(fServer->PrivateData());
|
||||||
|
if (server != NULL)
|
||||||
|
server->RemoveFileSystem(this);
|
||||||
|
}
|
||||||
|
|
||||||
mutex_destroy(&fDelegationLock);
|
mutex_destroy(&fDelegationLock);
|
||||||
mutex_destroy(&fOpenLock);
|
mutex_destroy(&fOpenLock);
|
||||||
|
|||||||
Reference in New Issue
Block a user