Don't leak memory when winnowing disk devices

- Improve logging a little
 - Don't leak Device*, but delete the raw pointer when erasing
 - Document that DeviceInfo takes ownership and doesn't leak
This commit is contained in:
Adriaan de Groot 2017-08-30 07:50:24 -04:00
parent e26d5ab206
commit 0e96621b94
2 changed files with 18 additions and 7 deletions

View file

@ -122,6 +122,7 @@ PartitionCoreModule::doInit()
cDebug() << "node\tcapacity\tname\tprettyName";
for ( auto device : devices )
{
// Gives ownership of the Device* to the DeviceInfo object
auto deviceInfo = new DeviceInfo( device );
m_deviceInfos << deviceInfo;
cDebug() << device->deviceNode() << device->capacity() << device->name() << device->prettyName();