From 64c91c7da66ba71e2bb32077680f234aba4ac65d Mon Sep 17 00:00:00 2001
From: Chris Xiong <chirs241097@gmail.com>
Date: Fri, 16 Jun 2017 23:51:26 +0800
Subject: Code refactoring and fix to memory leaks.

---
 qmidiplayer-desktop/qmphelpwindow.hpp | 2 +-
 qmidiplayer-desktop/qmpmainwindow.cpp | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

(limited to 'qmidiplayer-desktop')

diff --git a/qmidiplayer-desktop/qmphelpwindow.hpp b/qmidiplayer-desktop/qmphelpwindow.hpp
index 75f8679..f68e38e 100644
--- a/qmidiplayer-desktop/qmphelpwindow.hpp
+++ b/qmidiplayer-desktop/qmphelpwindow.hpp
@@ -2,7 +2,7 @@
 #define QMPHELPWINDOW_H
 
 #include <QDialog>
-#define APP_VERSION "0.8.5"
+#define APP_VERSION "0.8.6"
 #ifndef BUILD_MACHINE
 #define BUILD_MACHINE UNKNOWN
 #endif
diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp
index d65d873..d2c2d0d 100644
--- a/qmidiplayer-desktop/qmpmainwindow.cpp
+++ b/qmidiplayer-desktop/qmpmainwindow.cpp
@@ -70,6 +70,12 @@ qmpMainWindow::qmpMainWindow(QWidget *parent) :
 
 qmpMainWindow::~qmpMainWindow()
 {
+	QList<QAction*>a=ui->lbFileName->actions();
+	for(unsigned i=0;i<a.size();++i)
+	{
+		ui->lbFileName->removeAction(a[i]);
+		delete a[i];
+	}
 	pmgr->deinitPlugins();
 	delete pmgr;if(player)delete player;
 	if(timer)delete timer;
@@ -79,6 +85,9 @@ qmpMainWindow::~qmpMainWindow()
 	delete plistw;plistw=NULL;
 	delete infow;infow=NULL;
 	delete settingsw;settingsw=NULL;
+	delete panicf;panicf=NULL;
+	delete renderf;renderf=NULL;
+	delete reloadsynf;reloadsynf=NULL;
 	delete ui;
 }
 
-- 
cgit v1.2.3