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>
This commit is contained in:
@ -99,7 +99,7 @@ NewInstanceDialog::NewInstanceDialog(const QString & initialGroup, const QString
|
||||
// NOTE: m_buttons must be initialized before PageContainer, because it indirectly accesses m_buttons through setSuggestedPack! Do not move this below.
|
||||
m_buttons = new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
|
||||
m_container = new PageContainer(this);
|
||||
m_container = new PageContainer(this, {}, this);
|
||||
m_container->setSizePolicy(QSizePolicy::Policy::Preferred, QSizePolicy::Policy::Expanding);
|
||||
m_container->layout()->setContentsMargins(0, 0, 0, 0);
|
||||
ui->verticalLayout->insertWidget(2, m_container);
|
||||
|
@ -89,7 +89,7 @@ void ResourceDownloadDialog::reject()
|
||||
// won't work with subclasses if we put it in this ctor.
|
||||
void ResourceDownloadDialog::initializeContainer()
|
||||
{
|
||||
m_container = new PageContainer(this);
|
||||
m_container = new PageContainer(this, {}, this);
|
||||
m_container->setSizePolicy(QSizePolicy::Policy::Preferred, QSizePolicy::Policy::Expanding);
|
||||
m_container->layout()->setContentsMargins(0, 0, 0, 0);
|
||||
m_vertical_layout.addWidget(m_container);
|
||||
|
@ -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++;
|
||||
|
Reference in New Issue
Block a user