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:
parent
2570af9d13
commit
d63b9e14a0
@ -40,7 +40,6 @@ public:
|
|||||||
: fPartitionList(list)
|
: fPartitionList(list)
|
||||||
, fDiskCount(diskCount)
|
, fDiskCount(diskCount)
|
||||||
, fSpaceIDMap(spaceIDMap)
|
, fSpaceIDMap(spaceIDMap)
|
||||||
, fLastPreparedDevice(NULL)
|
|
||||||
{
|
{
|
||||||
fDiskCount = 0;
|
fDiskCount = 0;
|
||||||
fSpaceIDMap.Clear();
|
fSpaceIDMap.Clear();
|
||||||
@ -52,11 +51,6 @@ public:
|
|||||||
delete row;
|
delete row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
~ListPopulatorVisitor()
|
|
||||||
{
|
|
||||||
if (fLastPreparedDevice)
|
|
||||||
fLastPreparedDevice->CancelModifications();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool Visit(BDiskDevice* device)
|
virtual bool Visit(BDiskDevice* device)
|
||||||
{
|
{
|
||||||
@ -64,12 +58,7 @@ public:
|
|||||||
// if we don't prepare the device for modifications,
|
// if we don't prepare the device for modifications,
|
||||||
// we cannot get information about available empty
|
// we cannot get information about available empty
|
||||||
// regions on the device or child partitions
|
// regions on the device or child partitions
|
||||||
if (fLastPreparedDevice) {
|
device->PrepareModifications();
|
||||||
fLastPreparedDevice->CancelModifications();
|
|
||||||
fLastPreparedDevice = NULL;
|
|
||||||
}
|
|
||||||
if (device->PrepareModifications() == B_OK)
|
|
||||||
fLastPreparedDevice = device;
|
|
||||||
_AddPartition(device);
|
_AddPartition(device);
|
||||||
return false; // Don't stop yet!
|
return false; // Don't stop yet!
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user