Using QScopedPointer

This commit is contained in:
Louis-Bertrand Varin
2017-10-14 22:12:45 -04:00
committed by Janek Bevendorff
parent 0fe06b3fbb
commit a1aad5d165

View File

@@ -162,8 +162,8 @@ void DatabaseOpenWidget::enterKey(const QString& pw, const QString& keyFile)
void DatabaseOpenWidget::openDatabase()
{
KeePass2Reader reader;
CompositeKey* masterKey = databaseKey();
if (masterKey == nullptr) {
QScopedPointer<CompositeKey> masterKey(databaseKey());
if (masterKey.isNull()) {
return;
}
@@ -190,8 +190,6 @@ void DatabaseOpenWidget::openDatabase()
MessageWidget::Error);
m_ui->editPassword->clear();
}
delete masterKey;
}
CompositeKey* DatabaseOpenWidget::databaseKey()