]> Devoid-pointer.net GitWeb - anyanka.git/commitdiff
Delete m_background pixmap in SignalDrawer destructor
authorMichal Malý <madcatxster@devoid-pointer.net>
Mon, 30 Jun 2014 00:05:52 +0000 (02:05 +0200)
committerMichal Malý <madcatxster@devoid-pointer.net>
Mon, 30 Jun 2014 00:05:52 +0000 (02:05 +0200)
signaldrawer.cpp

index be52023e9231ea7141df309d29a431c68b008226..aea8ed39dea125a18886bb266ac41ae0c2107972 100644 (file)
@@ -319,11 +319,10 @@ bool SignalDrawer::renderGraph(QPixmap* const target)
 
 void SignalDrawer::renderFresh(QPixmap* const fresh)
 {
-  if (m_pixmap)
-    delete m_pixmap;
+  delete m_pixmap;
   m_pixmap = fresh;
-  if (m_background)
-    delete m_background;
+
+  delete m_background;
   m_background = new QPixmap(*m_pixmap);
 }
 
@@ -486,4 +485,5 @@ void SignalDrawer::setNewRelativeConstraints(const double fromX, const double fr
 SignalDrawer::~SignalDrawer()
 {
   delete m_pixmap;
+  delete m_background;
 }