Skip to content

Commit 962b614

Browse files
committed
cancel the _scheduleCleanup on CacheStore dispose (PR by EdwynZN: Baseflow#418)
1 parent 95c5bae commit 962b614

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

flutter_cache_manager/lib/src/cache_store.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ class CacheStore {
208208
}
209209

210210
Future<void> dispose() async {
211+
if (_scheduledCleanup != null) {
212+
_scheduledCleanup?.cancel();
213+
}
214+
211215
final provider = await _cacheInfoRepository;
212216
await provider.close();
213217
}

0 commit comments

Comments
 (0)