[python] matplotlib: flush heap memory when any error is raised

This commit is contained in:
Émilie Feral
2020-03-30 14:06:35 +02:00
parent 2f4064d92b
commit 574eacb69c
2 changed files with 10 additions and 0 deletions

View File

@@ -72,6 +72,12 @@ void modpyplot_gc_collect() {
);
}
void modpyplot_flush_used_heap() {
if (sPlotStore) {
// Clean the store object
sPlotStore->flush();
}
}
mp_obj_t modpyplot_arrow(size_t n_args, const mp_obj_t *args) {
assert(n_args == 4);
assert(sPlotStore != nullptr);