Commit 12dbde3a authored by Locatelli's avatar Locatelli
Browse files

Remove unused stuff

parent d48d9064
...@@ -60,9 +60,8 @@ Mpl::Mpl() throw (Error) { ...@@ -60,9 +60,8 @@ Mpl::Mpl() throw (Error) {
PyEval_InitThreads(); PyEval_InitThreads();
// Import the matplotlib module // Import the matplotlib module
PythonObject matplotlib;
try { try {
matplotlib = bp::import(bp::str("matplotlib")); m_Matplotlib = bp::import(bp::str("matplotlib"));
} catch(...) { } catch(...) {
throw Error("Mpl", "constructor", "Error when importing the module matplotlib"); throw Error("Mpl", "constructor", "Error when importing the module matplotlib");
} }
...@@ -113,17 +112,17 @@ Mpl::Mpl() throw (Error) { ...@@ -113,17 +112,17 @@ Mpl::Mpl() throw (Error) {
// Use Qt5Agg for toolbar look and feel // Use Qt5Agg for toolbar look and feel
auto args = bp::make_tuple("Qt5Agg"); auto args = bp::make_tuple("Qt5Agg");
try { try {
matplotlib.attr("use")(*args); m_Matplotlib.attr("use")(*args);
} catch(...) { } catch(...) {
throw Error("Mpl", "constructor", "Error when activating QT5Agg"); throw Error("Mpl", "constructor", "Error when activating QT5Agg");
} }
// Get Py QT5 for forcine QT5 // // Get Py QT5 for forcine QT5
try { // try {
auto qt5Module = bp::import(bp::str("PyQt5")); // auto qt5Module = bp::import(bp::str("PyQt5"));
} catch (...) { // } catch (...) {
throw Error("Mpl", "Mpl", "Error when getting PyQt5"); // throw Error("Mpl", "Mpl", "Error when getting PyQt5");
} // }
// Get matplotlib BackEnd for qt5 // Get matplotlib BackEnd for qt5
try { try {
...@@ -148,17 +147,16 @@ Mpl::Mpl() throw (Error) { ...@@ -148,17 +147,16 @@ Mpl::Mpl() throw (Error) {
* destructor * destructor
*/ */
Mpl::~Mpl() { Mpl::~Mpl() {
{ m_GarbageCollector.reset();
m_PyPlot.reset(); m_BackendsModule.reset();
m_FigureModule.reset(); m_ColorsModule.reset();
m_LinesModule.reset(); m_PatchesModule.reset();
m_TextModule.reset(); m_WidgetsModule.reset();
m_ColorsModule.reset(); m_TextModule.reset();
m_BackendsModule.reset(); m_LinesModule.reset();
m_WidgetsModule.reset(); m_FigureModule.reset();
m_PatchesModule.reset(); m_PyPlot.reset();
m_GarbageCollector.reset(); m_Matplotlib.reset();
}
Py_Finalize(); Py_Finalize();
} }
......
...@@ -216,6 +216,7 @@ public: ...@@ -216,6 +216,7 @@ public:
private: private:
PythonObject m_Matplotlib;
PythonObject m_PyPlot; //! Matplotlib pyplot Python module object PythonObject m_PyPlot; //! Matplotlib pyplot Python module object
PythonObject m_FigureModule; //! Matplotlib figure module PythonObject m_FigureModule; //! Matplotlib figure module
PythonObject m_LinesModule; //! Matplotlib lines module PythonObject m_LinesModule; //! Matplotlib lines module
......
...@@ -75,6 +75,7 @@ MplFigure::~MplFigure() { ...@@ -75,6 +75,7 @@ MplFigure::~MplFigure() {
m_Figure.reset(); m_Figure.reset();
m_Canvas.reset(); m_Canvas.reset();
m_Toolbar.reset(); m_Toolbar.reset();
m_MainAxis.reset();
// try { // try {
// m_Mpl.garbageCollect(); // m_Mpl.garbageCollect();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment