I think the ListPopulatorVisitor gets BDiskSystems allocated on the stack,

so tracking the modification preparations is both unnecessary and
as canceling is performed on a stale pointer...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26464 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2008-07-17 00:46:11 +00:00
parent 2570af9d13
commit d63b9e14a0

View File

@ -40,7 +40,6 @@ public:
: fPartitionList(list)
, fDiskCount(diskCount)
, fSpaceIDMap(spaceIDMap)
, fLastPreparedDevice(NULL)
{
fDiskCount = 0;
fSpaceIDMap.Clear();
@ -52,11 +51,6 @@ public:
delete row;
}
}
~ListPopulatorVisitor()
{
if (fLastPreparedDevice)
fLastPreparedDevice->CancelModifications();
}
virtual bool Visit(BDiskDevice* device)
{
@ -64,12 +58,7 @@ public:
// if we don't prepare the device for modifications,
// we cannot get information about available empty
// regions on the device or child partitions
if (fLastPreparedDevice) {
fLastPreparedDevice->CancelModifications();
fLastPreparedDevice = NULL;
}
if (device->PrepareModifications() == B_OK)
fLastPreparedDevice = device;
device->PrepareModifications();
_AddPartition(device);
return false; // Don't stop yet!
}