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:
Adrien Destugues
2014-10-28 23:52:57 +01:00
parent 04dbe5b1c5
commit 4ed39e6a62
3 changed files with 17 additions and 1 deletions
@@ -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
{