Skip to content
Discussion options

You must be logged in to vote

@Mars-CN you need to use m_new_obj_with_finaliser to construct the struct instance (so that the GC knows to call your finaliser), and then add a __del__ entry to your locals dict (this is your destructor/deinit method).

Look at e.g. extmod/modsocket.c for an example.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Mars-CN
Comment options

@jimmo
Comment options

@Mars-CN
Comment options

@Josverl
Comment options

Josverl Jul 16, 2023
Collaborator Sponsor

Answer selected by Mars-CN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
ESP32
Labels
None yet
3 participants