diff --git a/src/modules/partition/PartitionCoreModule.cpp b/src/modules/partition/PartitionCoreModule.cpp index e28bea6d1..58a1ebfe2 100644 --- a/src/modules/partition/PartitionCoreModule.cpp +++ b/src/modules/partition/PartitionCoreModule.cpp @@ -183,9 +183,9 @@ PartitionCoreModule::deletePartition( Device* device, Partition* partition ) // I am not sure if we can iterate on Partition::children() while // deleting them, so let's play it safe and keep our own list. QList< Partition* > lst; - for ( auto partition : partition->children() ) - if ( !PMUtils::isPartitionFreeSpace( partition ) ) - lst << partition; + for ( auto childPartition : partition->children() ) + if ( !PMUtils::isPartitionFreeSpace( childPartition ) ) + lst << childPartition; for ( auto partition : lst ) deletePartition( device, partition );