Commit 00a1b5fb authored by Kwon-Young Choi's avatar Kwon-Young Choi
Browse files

save output of getStorageAccessFromDevice into a const variable to avoid...

save output of getStorageAccessFromDevice into a const variable to avoid detaching the QList container

See: https://doc.qt.io/qt-5/containers.html#the-iterator-classes
parent f4e7a1b8
......@@ -184,7 +184,8 @@ void mount(const QString &file)
*/
void unmount(const Solid::Device &device)
{
for (Solid::Device storageAccessDevice : getStorageAccessFromDevice(device)) {
const QList<Solid::Device> devices = getStorageAccessFromDevice(device);
for (Solid::Device storageAccessDevice : devices) {
auto storageAccess = storageAccessDevice.as<Solid::StorageAccess>();
if (storageAccess->isAccessible()) {
storageAccess->teardown();
......
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