ProjectExplorer: Fix some problems with plugin unloading

It was not possible to return false from
ProjectExplorerPlugin::initialize() without triggering crashes.

Change-Id: I96b2f80c835e69769f64f9b9c61f473e9ff88623
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2019-10-15 14:08:02 +02:00
parent 42fba8ee3b
commit e90a48e639
6 changed files with 17 additions and 2 deletions

View File

@@ -429,6 +429,13 @@ void WelcomeMode::addPage(IWelcomePage *page)
stackPage->setAutoFillBackground(true);
m_pageStack->insertWidget(idx, stackPage);
connect(page, &QObject::destroyed, this, [this, page, stackPage, pageButton] {
m_pluginList.removeOne(page);
m_pageButtons.removeOne(pageButton);
delete pageButton;
delete stackPage;
});
auto onClicked = [this, pageId, stackPage] {
m_activePage = pageId;
m_pageStack->setCurrentWidget(stackPage);