blk/mtdoutstream: flush before close

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
This commit is contained in:
buxiasen
2024-11-08 12:13:55 +08:00
committed by Xiang Xiao
parent bab1a5d714
commit d6c746e88d
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -174,6 +174,7 @@ void lib_blkoutstream_close(FAR struct lib_blkoutstream_s *stream)
if (stream->cache != NULL)
{
blkoutstream_flush(&stream->common);
lib_free(stream->cache);
stream->cache = NULL;
}
+1
View File
@@ -240,6 +240,7 @@ void lib_mtdoutstream_close(FAR struct lib_mtdoutstream_s *stream)
if (stream->cache != NULL)
{
mtdoutstream_flush(&stream->common);
lib_free(stream->cache);
stream->cache = NULL;
}