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
This commit is contained in:
Stephan Aßmus
2008-07-26 18:57:14 +00:00
parent 27a76e1d73
commit 9de19e0d0e
+5
View File
@@ -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);