Skip to content

Commit

Permalink
deinit: Work harder to ensure storage is released at deinit
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler committed Apr 14, 2020
1 parent 5fcba97 commit caea4e0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions shared-module/_protomatter/Protomatter.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,14 @@ void common_hal_protomatter_protomatter_deinit(protomatter_protomatter_obj_t* se
}
memset(&self->core, 0, sizeof(self->core));

// If it was supervisor-allocated, it is supervisor-freed and the pointer
// is zeroed, otherwise the pointer is just zeroed
_PM_FREE(self->bufinfo.buf);
self->base.type = NULL;

// If a framebuffer was passed in to the constructor, NULL the reference
// here so that it will become GC'able
self->framebuffer = NULL;
}

void protomatter_protomatter_collect_ptrs(protomatter_protomatter_obj_t* self) {
Expand Down

0 comments on commit caea4e0

Please sign in to comment.