mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 21:34:07 +08:00
blk/mtdoutstream: flush before close
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user