]> Devoid-pointer.net GitWeb - anyanka.git/commitdiff
Delete pixmaps on GraphView destruction (memory leak).
authorMichal Malý <madcatxster@prifuk.cz>
Tue, 19 Nov 2013 20:51:15 +0000 (21:51 +0100)
committerMichal Malý <madcatxster@prifuk.cz>
Tue, 19 Nov 2013 20:51:15 +0000 (21:51 +0100)
gui/graphview.cpp
gui/graphview.h

index 602aa865daa23dd595fc76511a93ecc187982279..6aa98f594255340cc8cdca42df30afeffe973c45 100644 (file)
@@ -576,3 +576,13 @@ void GraphView::onUpdateGraph(double* data, size_t len, double min, double max)
   this->drawGraph();
   this->update();
 }
+
+GraphView::~GraphView()
+{
+  if (m_backbuffer != nullptr)
+    delete m_backbuffer;
+  if (m_plainGraph != nullptr)
+    delete m_plainGraph;
+  if (m_drawData != nullptr)
+    delete[] m_drawData;
+}
index d0c37a7c547f86c14d86d324e213b09d2822b2ea..c26f034b7f0bdf5928c55419b2bf824719f57e28 100644 (file)
@@ -39,6 +39,7 @@ public:
   };
 
   explicit GraphView(QWidget* parent = nullptr);
+  ~GraphView();
   void leaveEvent(QEvent* );
   void mouseDoubleClickEvent(QMouseEvent* );
   void mouseMoveEvent(QMouseEvent* ev);