GH-2485 fix crash bug while creating instances

This commit is contained in:
Petr Mrázek
2018-12-14 01:18:18 +01:00
parent 075e173fbd
commit 14bb666a20
3 changed files with 6 additions and 8 deletions

View File

@ -1283,7 +1283,7 @@ void MainWindow::runModalTask(Task *task)
void MainWindow::instanceFromInstanceTask(InstanceTask *rawTask)
{
std::unique_ptr<Task> task(MMC->instances()->wrapInstanceTask(rawTask));
unique_qobject_ptr<Task> task(MMC->instances()->wrapInstanceTask(rawTask));
runModalTask(task.get());
}
@ -1300,7 +1300,7 @@ void MainWindow::on_actionCopyInstance_triggered()
copyTask->setName(copyInstDlg.instName());
copyTask->setGroup(copyInstDlg.instGroup());
copyTask->setIcon(copyInstDlg.iconKey());
std::unique_ptr<Task> task(MMC->instances()->wrapInstanceTask(copyTask));
unique_qobject_ptr<Task> task(MMC->instances()->wrapInstanceTask(copyTask));
runModalTask(task.get());
}

View File

@ -40,7 +40,7 @@ void LegacyUpgradePage::on_upgradeButton_clicked()
upgradeTask->setName(newName);
upgradeTask->setGroup(MMC->instances()->getInstanceGroup(m_inst->id()));
upgradeTask->setIcon(m_inst->iconKey());
std::unique_ptr<Task> task(MMC->instances()->wrapInstanceTask(upgradeTask));
unique_qobject_ptr<Task> task(MMC->instances()->wrapInstanceTask(upgradeTask));
runModalTask(task.get());
}