disk device manager: check that partitions are unmounted before uninitializing.
when uninitializing a partition or a disk (removing the partition table), check that all partitions from that table are unmounted, as they are about to become invalid. Fixes #8827.
This commit is contained in:
@@ -559,6 +559,20 @@ KPartition::IsMounted() const
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
KPartition::IsChildMounted()
|
||||
{
|
||||
struct IsMountedVisitor : KPartitionVisitor {
|
||||
virtual bool VisitPre(KPartition* partition)
|
||||
{
|
||||
return partition->IsMounted();
|
||||
}
|
||||
} checkVisitor;
|
||||
|
||||
return VisitEachDescendant(&checkVisitor) != NULL;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
KPartition::IsDevice() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user