summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-08-19 09:04:58 +0200
committerPetr Mrázek <peterix@gmail.com>2016-08-19 09:04:58 +0200
commiteb747e08b78d8630413b9bdb3a96108ccfcc2ac8 (patch)
treec6edecbc9c79e08dcb03d0248f2840a057fc8d24
parent67eca08b2260f19ff296c0b6cb73eb3b0479e4b2 (diff)
downloadMultiMC-eb747e08b78d8630413b9bdb3a96108ccfcc2ac8.tar
MultiMC-eb747e08b78d8630413b9bdb3a96108ccfcc2ac8.tar.gz
MultiMC-eb747e08b78d8630413b9bdb3a96108ccfcc2ac8.tar.lz
MultiMC-eb747e08b78d8630413b9bdb3a96108ccfcc2ac8.tar.xz
MultiMC-eb747e08b78d8630413b9bdb3a96108ccfcc2ac8.zip
NOISSUE fix minor memory leaks
-rw-r--r--api/logic/minecraft/MinecraftProfile.cpp8
-rw-r--r--api/logic/minecraft/MinecraftProfile.h1
-rw-r--r--application/InstanceWindow.cpp5
-rw-r--r--application/MainWindow.cpp3
-rw-r--r--application/widgets/LogView.cpp1
-rw-r--r--application/widgets/PageContainer.cpp1
-rw-r--r--application/widgets/PageContainer.h1
7 files changed, 12 insertions, 8 deletions
diff --git a/api/logic/minecraft/MinecraftProfile.cpp b/api/logic/minecraft/MinecraftProfile.cpp
index 19127a54..fbd67875 100644
--- a/api/logic/minecraft/MinecraftProfile.cpp
+++ b/api/logic/minecraft/MinecraftProfile.cpp
@@ -33,6 +33,14 @@ MinecraftProfile::MinecraftProfile(ProfileStrategy *strategy)
clear();
}
+MinecraftProfile::~MinecraftProfile()
+{
+ if(m_strategy)
+ {
+ delete m_strategy;
+ }
+}
+
void MinecraftProfile::setStrategy(ProfileStrategy* strategy)
{
Q_ASSERT(strategy != nullptr);
diff --git a/api/logic/minecraft/MinecraftProfile.h b/api/logic/minecraft/MinecraftProfile.h
index cc9b89b1..22dca979 100644
--- a/api/logic/minecraft/MinecraftProfile.h
+++ b/api/logic/minecraft/MinecraftProfile.h
@@ -38,6 +38,7 @@ class MULTIMC_LOGIC_EXPORT MinecraftProfile : public QAbstractListModel
public:
explicit MinecraftProfile(ProfileStrategy *strategy);
+ virtual ~MinecraftProfile();
void setStrategy(ProfileStrategy * strategy);
ProfileStrategy *strategy();
diff --git a/application/InstanceWindow.cpp b/application/InstanceWindow.cpp
index 6b24f488..3bfc78db 100644
--- a/application/InstanceWindow.cpp
+++ b/application/InstanceWindow.cpp
@@ -46,13 +46,8 @@ InstanceWindow::InstanceWindow(InstancePtr instance, QWidget *parent)
// Add page container
{
- auto mainLayout = new QVBoxLayout;
auto provider = std::make_shared<InstancePageProvider>(m_instance);
m_container = new PageContainer(provider, "console", this);
- mainLayout->addWidget(m_container);
- mainLayout->setSpacing(0);
- mainLayout->setContentsMargins(0,0,0,0);
- setLayout(mainLayout);
setCentralWidget(m_container);
}
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index 2749860b..c91f5256 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -436,7 +436,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
view = new GroupView(ui->centralWidget);
view->setSelectionMode(QAbstractItemView::SingleSelection);
- view->setItemDelegate(new ListViewDelegate());
+ // FIXME: leaks ListViewDelegate
+ view->setItemDelegate(new ListViewDelegate(this));
view->setFrameShape(QFrame::NoFrame);
// do not show ugly blue border on the mac
view->setAttribute(Qt::WA_MacShowFocusRect, false);
diff --git a/application/widgets/LogView.cpp b/application/widgets/LogView.cpp
index 9cd91b2e..8e0346fa 100644
--- a/application/widgets/LogView.cpp
+++ b/application/widgets/LogView.cpp
@@ -10,6 +10,7 @@ LogView::LogView(QWidget* parent) : QPlainTextEdit(parent)
LogView::~LogView()
{
+ delete m_defaultFormat;
}
void LogView::setWordWrap(bool wrapping)
diff --git a/application/widgets/PageContainer.cpp b/application/widgets/PageContainer.cpp
index 04da5c8b..24814d57 100644
--- a/application/widgets/PageContainer.cpp
+++ b/application/widgets/PageContainer.cpp
@@ -126,7 +126,6 @@ void PageContainer::refresh()
void PageContainer::createUI()
{
m_pageStack = new QStackedLayout;
- m_filter = new QLineEdit;
m_pageList = new PageView;
m_header = new QLabel();
m_iconHeader = new IconLabel(this, QIcon(), QSize(24, 24));
diff --git a/application/widgets/PageContainer.h b/application/widgets/PageContainer.h
index 84504fb6..93971209 100644
--- a/application/widgets/PageContainer.h
+++ b/application/widgets/PageContainer.h
@@ -60,7 +60,6 @@ private:
QSortFilterProxyModel *m_proxyModel;
PageModel *m_model;
QStackedLayout *m_pageStack;
- QLineEdit *m_filter;
QListView *m_pageList;
QLabel *m_header;
IconLabel *m_iconHeader;