diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-25 16:16:58 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-25 16:16:58 -0700 |
commit | e61d8e4dc870aaeb2949557a87cf2749df573667 (patch) | |
tree | c96f0dde54c84ada4bba7cf1e47534fbf16aa90b | |
parent | 6b8fe283f0bda66806175de10ba5874a4afdae45 (diff) | |
download | PrismLauncher-e61d8e4dc870aaeb2949557a87cf2749df573667.tar.gz PrismLauncher-e61d8e4dc870aaeb2949557a87cf2749df573667.tar.bz2 PrismLauncher-e61d8e4dc870aaeb2949557a87cf2749df573667.zip |
fix: katabasis and QStyle leaks
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
-rw-r--r-- | launcher/ui/pages/instance/ManagedPackPage.cpp | 7 | ||||
-rw-r--r-- | libraries/katabasis/src/Reply.cpp | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/launcher/ui/pages/instance/ManagedPackPage.cpp b/launcher/ui/pages/instance/ManagedPackPage.cpp index dc983d9a..593590f7 100644 --- a/launcher/ui/pages/instance/ManagedPackPage.cpp +++ b/launcher/ui/pages/instance/ManagedPackPage.cpp @@ -62,8 +62,11 @@ ManagedPackPage::ManagedPackPage(BaseInstance* inst, InstanceWindow* instance_wi // NOTE: GTK2 themes crash with the proxy style. // This seems like an upstream bug, so there's not much else that can be done. - if (!QStyleFactory::keys().contains("gtk2")) - ui->versionsComboBox->setStyle(new NoBigComboBoxStyle(ui->versionsComboBox->style())); + if (!QStyleFactory::keys().contains("gtk2")){ + auto comboStyle = new NoBigComboBoxStyle(ui->versionsComboBox->style()); + comboStyle->setParent(APPLICATION); // make sure this gets cleaned up (setting to simply `this` causes it to be freed too soon) + ui->versionsComboBox->setStyle(comboStyle); + } ui->reloadButton->setVisible(false); connect(ui->reloadButton, &QPushButton::clicked, this, [this](bool){ diff --git a/libraries/katabasis/src/Reply.cpp b/libraries/katabasis/src/Reply.cpp index 3e27a7e6..c2607900 100644 --- a/libraries/katabasis/src/Reply.cpp +++ b/libraries/katabasis/src/Reply.cpp @@ -40,6 +40,8 @@ void ReplyList::remove(QNetworkReply *reply) { if (o2Reply) { o2Reply->stop(); (void)replies_.removeOne(o2Reply); + // we took ownership, we must free + delete o2Reply; } } |