mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-23 00:10:37 -05:00
Fix crash when canceling save of new database (#2601)
* Fix crash when canceling save of new database * Standardize use of DatabaseWidget::save() function * Close new database tabs that are "discarded" * Fixes #2604. autoSaveOnExit setting * Re-implement autosave functionality
This commit is contained in:
parent
d66299260c
commit
c74664097b
7 changed files with 48 additions and 18 deletions
|
|
@ -515,9 +515,12 @@ DatabaseWidget* DatabaseTabWidget::currentDatabaseWidget()
|
|||
void DatabaseTabWidget::lockDatabases()
|
||||
{
|
||||
for (int i = 0, c = count(); i < c; ++i) {
|
||||
if (!databaseWidgetFromIndex(i)->lock()) {
|
||||
return;
|
||||
auto dbWidget = databaseWidgetFromIndex(i);
|
||||
if (dbWidget->lock() && dbWidget->database()->filePath().isEmpty()) {
|
||||
// If we locked a database without a file close the tab
|
||||
closeDatabaseTab(dbWidget);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue