Skip to content

Commit 7b7df80

Browse files
author
Benjamin Pasero
committed
storage - ensure to close DB on error
1 parent 6dcade9 commit 7b7df80

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/vs/base/node/storage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ export class SQLiteStorageImpl {
437437

438438
const db = new (this.logger.isTracing ? sqlite3.verbose().Database : sqlite3.Database)(path, error => {
439439
if (error) {
440-
return reject(error);
440+
return db.close(() => reject(error));
441441
}
442442

443443
// The following exec() statement serves two purposes:
@@ -454,7 +454,7 @@ export class SQLiteStorageImpl {
454454
}, error => {
455455
mark('didSetupSQLiteSchema');
456456

457-
reject(error);
457+
db.close(() => reject(error));
458458
});
459459
});
460460

0 commit comments

Comments
 (0)