diff --git a/python/port/mod/matplotlib/modpyplot.cpp b/python/port/mod/matplotlib/modpyplot.cpp index 81972335e..3ab8682bd 100644 --- a/python/port/mod/matplotlib/modpyplot.cpp +++ b/python/port/mod/matplotlib/modpyplot.cpp @@ -37,11 +37,11 @@ mp_obj_t modpyplot___init__() { } void modpyplot_gc_collect() { - if (sPlotStore != nullptr) { + if (sPlotStore == nullptr) { return; } MicroPython::collectRootsAtAddress( - reinterpret_cast(&sPlotStore), + reinterpret_cast(sPlotStore), sizeof(Matplotlib::PlotStore) ); }