all: Use mp_obj_malloc_with_finaliser everywhere it's applicable.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2024-02-16 11:02:58 +11:00
parent 4133c03040
commit cae690d047
19 changed files with 30 additions and 55 deletions

View File

@@ -228,8 +228,7 @@ STATIC mp_obj_t fat_vfs_open(mp_obj_t self_in, mp_obj_t path_in, mp_obj_t mode_i
}
}
pyb_file_obj_t *o = m_new_obj_with_finaliser(pyb_file_obj_t);
o->base.type = type;
pyb_file_obj_t *o = mp_obj_malloc_with_finaliser(pyb_file_obj_t, type);
const char *fname = mp_obj_str_get_str(path_in);
FRESULT res = f_open(&self->fatfs, &o->fp, fname, mode);