diff --git a/headers/private/storage/MutablePartition.h b/headers/private/storage/MutablePartition.h index c4e3d9e24f..c473229b81 100644 --- a/headers/private/storage/MutablePartition.h +++ b/headers/private/storage/MutablePartition.h @@ -66,6 +66,9 @@ public: int32 CountChildren() const; int32 IndexOfChild(BMutablePartition* child) const; + void SetChangeFlags(uint32 flags); + uint32 ChangeFlags() const; + // for the partitioning system managing the parent void* ChildCookie() const; void SetChildCookie(void* cookie); @@ -89,6 +92,7 @@ private: user_partition_data* fData; BMutablePartition* fParent; BList fChildren; + uint32 fChangeFlags; void* fChildCookie; }; diff --git a/src/kits/storage/disk_device/MutablePartition.cpp b/src/kits/storage/disk_device/MutablePartition.cpp index d1bb57e0ab..a3f2fceeb0 100644 --- a/src/kits/storage/disk_device/MutablePartition.cpp +++ b/src/kits/storage/disk_device/MutablePartition.cpp @@ -321,7 +321,10 @@ BMutablePartition::DeleteChild(int32 index) if (!child) return B_BAD_VALUE; - delete child->fDelegate->Partition(); + // This will delete not only all delegates in the child's hierarchy, but + // also the respective partitions themselves, if they are no longer + // referenced. + child->fDelegate->Partition()->_DeleteDelegates(); return B_OK; } @@ -369,6 +372,22 @@ BMutablePartition::IndexOfChild(BMutablePartition* child) const } +// SetChangeFlags +void +BMutablePartition::SetChangeFlags(uint32 flags) +{ + fChangeFlags = flags; +} + + +// ChangeFlags +uint32 +BMutablePartition::ChangeFlags() const +{ + return fChangeFlags; +} + + // ChildCookie void* BMutablePartition::ChildCookie() const @@ -390,6 +409,7 @@ BMutablePartition::BMutablePartition(BPartition::Delegate* delegate) : fDelegate(delegate), fData(NULL), fParent(NULL), + fChangeFlags(0), fChildCookie(NULL) { }