1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-16 08:13:20 +00:00

Dispost of LiteDatabase instance (#928)

This commit is contained in:
Kyle Spearrin
2020-05-28 15:44:27 -04:00
committed by GitHub
parent cd3585be58
commit 0b29c6e5a4
3 changed files with 31 additions and 4 deletions

View File

@@ -1,11 +1,12 @@
using Bit.Core;
using Bit.Core.Abstractions;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Bit.App.Services
{
public class MobileStorageService : IStorageService
public class MobileStorageService : IStorageService, IDisposable
{
private readonly IStorageService _preferencesStorageService;
private readonly IStorageService _liteDbStorageService;
@@ -88,5 +89,17 @@ namespace Bit.App.Services
}
return _liteDbStorageService.RemoveAsync(key);
}
public void Dispose()
{
if (_liteDbStorageService is IDisposable disposableLiteDbService)
{
disposableLiteDbService.Dispose();
}
if (_preferencesStorageService is IDisposable disposablePrefService)
{
disposablePrefService.Dispose();
}
}
}
}