[python] Matplotlib: flush the plot store when the controller is popped

This commit is contained in:
Émilie Feral
2020-03-24 10:02:41 +01:00
parent 24cd5079d4
commit 7e73afc654
2 changed files with 11 additions and 1 deletions

View File

@@ -0,0 +1,10 @@
#include "plot_controller.h"
namespace Matplotlib {
void PlotController::viewDidDisappear() {
MicroPython::ExecutionViewControllerHelper::viewDidDisappear(this);
m_store->flush();
}
}

View File

@@ -13,7 +13,7 @@ public:
PlotController(PlotStore * store, MicroPython::ExecutionEnvironment * executiveEnvironment) : Shared::ZoomAndPanCurveViewController(nullptr), ExecutionViewControllerHelper(executiveEnvironment), m_store(store), m_view(m_store) {}
void viewWillAppear() override { MicroPython::ExecutionViewControllerHelper::viewWillAppear(this); }
void viewDidDisappear() override { MicroPython::ExecutionViewControllerHelper::viewDidDisappear(this); }
void viewDidDisappear() override;
protected:
Shared::CurveView * curveView() override { return &m_view; }