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(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;