diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-28 02:15:39 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-28 02:15:39 -0700 |
commit | a04a6f1e0d0d551506a86964c51e5ce6af5587b4 (patch) | |
tree | 8dac30aa1cb3f188a4a0dce5b734c5937068488a /launcher/ui/widgets | |
parent | 37420405c7b5dddb003533e1487ba45a2da5b808 (diff) | |
download | PrismLauncher-a04a6f1e0d0d551506a86964c51e5ce6af5587b4.tar.gz PrismLauncher-a04a6f1e0d0d551506a86964c51e5ce6af5587b4.tar.bz2 PrismLauncher-a04a6f1e0d0d551506a86964c51e5ce6af5587b4.zip |
fix(memory leak): don't give shared pointers out to foldermodels (causes cyclic refrence)
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/ui/widgets')
-rw-r--r-- | launcher/ui/widgets/PageContainer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/launcher/ui/widgets/PageContainer.cpp b/launcher/ui/widgets/PageContainer.cpp index 0a06a351..b9b17b42 100644 --- a/launcher/ui/widgets/PageContainer.cpp +++ b/launcher/ui/widgets/PageContainer.cpp @@ -87,7 +87,9 @@ PageContainer::PageContainer(BasePageProvider *pageProvider, QString defaultId, auto pages = pageProvider->getPages(); for (auto page : pages) { - page->stackIndex = m_pageStack->addWidget(dynamic_cast<QWidget *>(page)); + auto widget = dynamic_cast<QWidget *>(page); + widget->setParent(this); + page->stackIndex = m_pageStack->addWidget(widget); page->listIndex = counter; page->setParentContainer(this); counter++; |