@@ -49,7 +49,7 @@ static mp_obj_t mp_obj_new_i2ctarget_i2c_target_request(i2ctarget_i2c_target_obj
49
49
//| :param bool smbus: Use SMBUS timings if the hardware supports it"""
50
50
//| ...
51
51
static mp_obj_t i2ctarget_i2c_target_make_new (const mp_obj_type_t * type , size_t n_args , size_t n_kw , const mp_obj_t * all_args ) {
52
- i2ctarget_i2c_target_obj_t * self = mp_obj_malloc (i2ctarget_i2c_target_obj_t , & i2ctarget_i2c_target_type );
52
+ i2ctarget_i2c_target_obj_t * self = mp_obj_malloc_with_finaliser (i2ctarget_i2c_target_obj_t , & i2ctarget_i2c_target_type );
53
53
enum { ARG_scl , ARG_sda , ARG_addresses , ARG_smbus };
54
54
static const mp_arg_t allowed_args [] = {
55
55
{ MP_QSTR_scl , MP_ARG_REQUIRED | MP_ARG_OBJ },
@@ -186,6 +186,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(i2ctarget_i2c_target_request_obj, 1, i2ctarget
186
186
187
187
static const mp_rom_map_elem_t i2ctarget_i2c_target_locals_dict_table [] = {
188
188
{ MP_ROM_QSTR (MP_QSTR_deinit ), MP_ROM_PTR (& i2ctarget_i2c_target_deinit_obj ) },
189
+ { MP_ROM_QSTR (MP_QSTR___del__ ), MP_ROM_PTR (& i2ctarget_i2c_target_deinit_obj ) },
189
190
{ MP_ROM_QSTR (MP_QSTR___enter__ ), MP_ROM_PTR (& default___enter___obj ) },
190
191
{ MP_ROM_QSTR (MP_QSTR___exit__ ), MP_ROM_PTR (& i2ctarget_i2c_target___exit___obj ) },
191
192
{ MP_ROM_QSTR (MP_QSTR_request ), MP_ROM_PTR (& i2ctarget_i2c_target_request_obj ) },
0 commit comments