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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user