diff --git a/src/core/partition.cpp b/src/core/partition.cpp index 5feaf85..36b4a94 100644 --- a/src/core/partition.cpp +++ b/src/core/partition.cpp @@ -79,7 +79,8 @@ Partition::~Partition() // list of children). As a workaround, always remove a partition from its parent here in the dtor. // This presumably fixes 232092, but backporting is too risky until we're sure this doesn't cause // side-effects. - parent()->remove(this); + if (m_Parent) + parent()->remove(this); clearChildren(); deleteFileSystem(); } diff --git a/src/core/partition.h b/src/core/partition.h index 0464f37..bbda5a3 100644 --- a/src/core/partition.h +++ b/src/core/partition.h @@ -27,6 +27,7 @@ #include #include +#include class Device; class OperationStack; @@ -270,7 +271,7 @@ private: qint32 m_Number; Partitions m_Children; - PartitionNode* m_Parent; + QPointer< PartitionNode > m_Parent; FileSystem* m_FileSystem; PartitionRole m_Roles; qint64 m_FirstSector; diff --git a/src/ops/deleteoperation.h b/src/ops/deleteoperation.h index 6330f99..73972dd 100644 --- a/src/ops/deleteoperation.h +++ b/src/ops/deleteoperation.h @@ -24,7 +24,6 @@ #include "../ops/operation.h" -#include #include class Device; @@ -102,7 +101,7 @@ protected: private: Device& m_TargetDevice; - QPointer< Partition > m_DeletedPartition; + Partition* m_DeletedPartition; ShredAction m_ShredAction; Job* m_DeleteFileSystemJob; DeletePartitionJob* m_DeletePartitionJob;