From 2084e004c42706bc72ed8992e7303399ed63de61 Mon Sep 17 00:00:00 2001 From: Volker Lanz Date: Wed, 1 Oct 2008 16:21:13 +0000 Subject: [PATCH] When merging NewOperation and CreateFileSystemOperation, don't delete the old FS before trying to clone it. BUG: 171971 svn path=/trunk/playground/sysadmin/partitionmanager/; revision=866672 --- src/core/operationstack.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/operationstack.cpp b/src/core/operationstack.cpp index 99db6d2..84b3ac7 100644 --- a/src/core/operationstack.cpp +++ b/src/core/operationstack.cpp @@ -167,8 +167,12 @@ bool OperationStack::mergeNewOperation(Operation*& currentOp, Operation*& pushed { log() << i18nc("@info/plain", "Changing file system for a new partition: No new operation required."); - newOp->newPartition().deleteFileSystem(); - newOp->newPartition().setFileSystem(FileSystemFactory::cloneWithNewType(pushedCreateFileSystemOp->newFileSystem()->type(), newOp->newPartition().fileSystem())); + FileSystem* oldFs = &newOp->newPartition().fileSystem(); + + newOp->newPartition().setFileSystem(FileSystemFactory::cloneWithNewType(pushedCreateFileSystemOp->newFileSystem()->type(), *oldFs)); + + delete oldFs; + oldFs = NULL; delete pushedOp; pushedOp = NULL;