[vlc-commits] Qt: EPG fix memleak

Francois Cartegnie git at videolan.org
Sat Mar 5 16:25:46 CET 2011


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Mar  4 20:21:00 2011 +0100| [265821400e04c9a274987c8de1eb4b6d80cc640b] | committer: Francois Cartegnie

Qt: EPG fix memleak

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=265821400e04c9a274987c8de1eb4b6d80cc640b
---

 modules/gui/qt4/components/epg/EPGWidget.cpp |    7 +++++++
 modules/gui/qt4/components/epg/EPGWidget.hpp |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/components/epg/EPGWidget.cpp b/modules/gui/qt4/components/epg/EPGWidget.cpp
index 766dce9..9032b99 100644
--- a/modules/gui/qt4/components/epg/EPGWidget.cpp
+++ b/modules/gui/qt4/components/epg/EPGWidget.cpp
@@ -64,6 +64,13 @@ EPGWidget::EPGWidget( QWidget *parent ) : QWidget( parent )
              this, SIGNAL(itemSelectionChanged(EPGEvent*)) );
 }
 
+EPGWidget::~EPGWidget()
+{
+    foreach( const QString &str, m_events.uniqueKeys() )
+        foreach( EPGEvent *item, m_events.values( str ) )
+            delete item;
+}
+
 void EPGWidget::setZoom( int level )
 {
     double scale = (double)level / 20;
diff --git a/modules/gui/qt4/components/epg/EPGWidget.hpp b/modules/gui/qt4/components/epg/EPGWidget.hpp
index ad03eac..e47f195 100644
--- a/modules/gui/qt4/components/epg/EPGWidget.hpp
+++ b/modules/gui/qt4/components/epg/EPGWidget.hpp
@@ -42,6 +42,7 @@ class EPGWidget : public QWidget
     Q_OBJECT
 public:
     explicit EPGWidget( QWidget* parent = 0 );
+    ~EPGWidget();
 
 public slots:
     void setZoom( int level );



More information about the vlc-commits mailing list