vfs.cpp: Fix gcc6 crash.
Signed-off-by: Jérôme Duval <[email protected]>
This commit is contained in:
committed by
Jérôme Duval
parent
7e6a11ac5d
commit
5b55f6dba9
@@ -7275,7 +7275,9 @@ fs_mount(char* path, const char* device, const char* fsName, uint32 flags,
|
|||||||
FileDeviceDeleter() : id(-1) {}
|
FileDeviceDeleter() : id(-1) {}
|
||||||
~FileDeviceDeleter()
|
~FileDeviceDeleter()
|
||||||
{
|
{
|
||||||
KDiskDeviceManager::Default()->DeleteFileDevice(id);
|
KDiskDeviceManager* ddm = KDiskDeviceManager::Default();
|
||||||
|
if (ddm != NULL)
|
||||||
|
ddm->DeleteFileDevice(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
partition_id id;
|
partition_id id;
|
||||||
@@ -7780,8 +7782,11 @@ fs_unmount(char* path, dev_t mountID, uint32 flags, bool kernel)
|
|||||||
partition->SetVolumeID(-1);
|
partition->SetVolumeID(-1);
|
||||||
partition->SetMountCookie(NULL);
|
partition->SetMountCookie(NULL);
|
||||||
|
|
||||||
if (mount->owns_file_device)
|
if (mount->owns_file_device) {
|
||||||
KDiskDeviceManager::Default()->DeleteFileDevice(partition->ID());
|
KDiskDeviceManager* ddm = KDiskDeviceManager::Default();
|
||||||
|
if (ddm != NULL)
|
||||||
|
ddm->DeleteFileDevice(partition->ID());
|
||||||
|
}
|
||||||
partition->Unregister();
|
partition->Unregister();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user