From af722675e1d76d36001ddb23472708f2599e9063 Mon Sep 17 00:00:00 2001 From: Edwin Zambrano Date: Tue, 30 May 2023 13:50:23 -0600 Subject: [PATCH] close CacheStore in CacheManager.dispose and cancel internal timer --- flutter_cache_manager/lib/src/cache_manager.dart | 2 +- flutter_cache_manager/lib/src/cache_store.dart | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/flutter_cache_manager/lib/src/cache_manager.dart b/flutter_cache_manager/lib/src/cache_manager.dart index cae88db5..def02347 100644 --- a/flutter_cache_manager/lib/src/cache_manager.dart +++ b/flutter_cache_manager/lib/src/cache_manager.dart @@ -282,6 +282,6 @@ class CacheManager implements BaseCacheManager { /// Closes the cache database @override Future dispose() async { - await _config.repo.close(); + await _store.close(); } } diff --git a/flutter_cache_manager/lib/src/cache_store.dart b/flutter_cache_manager/lib/src/cache_store.dart index dca3a648..52e001bc 100644 --- a/flutter_cache_manager/lib/src/cache_store.dart +++ b/flutter_cache_manager/lib/src/cache_store.dart @@ -194,6 +194,7 @@ class CacheStore { } Future dispose() async { + _scheduledCleanup?.cancel(); final provider = await _cacheInfoRepository; await provider.close(); }