dispose method

Future<void> dispose()

销毁存储

Implementation

Future<void> dispose() async {
  _cleanupTimer?.cancel();
  _cleanupTimer = null;
  _flushTimer?.cancel();
  _flushTimer = null;
  // flush + close sink,确保缓冲数据落盘。
  await _fileSink?.flush();
  await _fileSink?.close();
  _fileSink = null;
  _memoryStorage.clear();
  _currentFileSize = 0;
  _currentLogFile = null;
  _storageDir = null;
}