Commit 022bcfaf authored by Gleb Popov's avatar Gleb Popov

Fix use-after-free error.

Submitted by: tijl
parent b843f5259bba
......@@ -140,12 +140,13 @@ void ObjectManager::removeBlock(QString dev)
ifaces << QStringLiteral("org.freedesktop.UDisks2.Block");
removeInterfaces(b->dbusPath, ifaces);
QDBusConnection::systemBus().unregisterObject(b->dbusPath.path());
delete b;
if(!b->hasNoDrive)
// delete drive only when we are deleting table block or any other non-partition block
if(!b->bPartition)
removeDrive(d->geomName);
delete b;
}
void ObjectManager::addDrive(QString dev)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment