Fix warning in SQL error log when creating an in-memory database

This fixes an invalid database pointer warning when trying to create a
new in-memory database.
This commit is contained in:
Martin Kleusberg
2020-07-08 15:44:12 +02:00
parent 7c3cce56d4
commit f4f014e741
+4 -1
View File
@@ -556,7 +556,10 @@ void MainWindow::fileNew()
void MainWindow::fileNewInMemoryDatabase()
{
db.create(":memory:");
// Open an in-memory database. We use open() instead of create() here because the extra work create() does is not needed
// when no files are stored on disk.
db.open(":memory:");
setCurrentFile(tr("In-Memory database"));
statusEncodingLabel->setText(db.getPragma("encoding"));
statusEncryptionLabel->setVisible(false);