From 9de19e0d0e5f36f109c70c62ebdef9371b0e901a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 26 Jul 2008 18:57:14 +0000 Subject: [PATCH] Calling BDiskDeviceSystem::CommitModifications() will delete all BPartition children of the device and recreate them so that they are updated to any changes. MainWindow::_Initialize() was using a stale BPartition pointer after calling CommitModifications(). Now the pointer is recreated from the id. Should fix #2548. Untested. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26643 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/drivesetup/MainWindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/apps/drivesetup/MainWindow.cpp b/src/apps/drivesetup/MainWindow.cpp index 897d3d099b..18d6c0d63f 100644 --- a/src/apps/drivesetup/MainWindow.cpp +++ b/src/apps/drivesetup/MainWindow.cpp @@ -808,6 +808,11 @@ MainWindow::_Initialize(BDiskDevice* disk, partition_id selectedPartition, // commit ret = modificationPreparer.CommitModifications(); + + // The partition pointer is toast now! Use the partition id to + // retrieve it again. + partition = disk->FindDescendant(selectedPartition); + if (ret == B_OK) { _DisplayPartitionError("The partition %s has been successfully " "initialized.\n", partition);