Insure that Web pages are deleted before the Web Profile to avoir error messages (#3845)

When exiting, GC complains that the Web Profile is released before Web pages that refer to it with the message: "Release of profile requested but WebEnginePage still not deleted. Expect troubles !".
The Web pages are now released explicitly in the destructor to insure that they are freed earlier than the Profile.
Fixes #3844
This commit is contained in:
Michel Dagenais
2021-03-13 15:16:22 -05:00
committed by GitHub
parent 3308372445
commit 921e81fad8
13 changed files with 29 additions and 0 deletions

View File

@@ -356,6 +356,7 @@ LTMWindow::LTMWindow(Context *context) :
LTMWindow::~LTMWindow()
{
delete popup;
if (dataSummary) delete dataSummary->page();
}
void

View File

@@ -410,6 +410,10 @@ PythonChart::PythonChart(Context *context, bool ridesummary) : GcChartWindow(con
web->setChecked(true);
}
PythonChart::~PythonChart()
{
if (canvas) delete canvas->page();
}
// switch between rendering to a web page and rendering to a chart page
void

View File

@@ -101,6 +101,7 @@ class PythonChart : public GcChartWindow, public PythonHost {
public:
PythonChart(Context *context, bool ridesummary);
~PythonChart();
// reveal
bool hasReveal() { return true; }

View File

@@ -173,6 +173,7 @@ RideMapWindow::RideMapWindow(Context *context, int mapType) : GcChartWindow(cont
RideMapWindow::~RideMapWindow()
{
delete webBridge;
if (view) delete view->page();
}
void

View File

@@ -146,6 +146,7 @@ RideSummaryWindow::~RideSummaryWindow()
// cancel background thread if needed
future.cancel();
future.waitForFinished();
if (rideSummary) delete rideSummary->page();
}
void

View File

@@ -203,6 +203,12 @@ OAuthDialog::OAuthDialog(Context *context, OAuthSite site, CloudService *service
}
}
OAuthDialog::~OAuthDialog()
{
if (view) delete view->page();
delete view; // view was constructed without a parent to delete it
}
// just ignore SSL handshake errors at all times
void
OAuthDialog::onSslErrors(QNetworkReply *reply, const QList<QSslError>&)

View File

@@ -62,6 +62,7 @@ public:
// will work with old config via site and new via cloudservice (which is null for calendar and withings for now)
OAuthDialog(Context *context, OAuthSite site, CloudService *service, QString baseURL="", QString clientsecret="");
~OAuthDialog();
bool sslLibMissing() { return noSSLlib; }

View File

@@ -981,6 +981,11 @@ GcUpgradeLogDialog::GcUpgradeLogDialog(QDir homeDir) : QDialog(NULL, Qt::Dialog)
report->page()->setHtml(reportText);
}
GcUpgradeLogDialog::~GcUpgradeLogDialog()
{
if (report) delete report->page();
}
void
GcUpgradeLogDialog::saveAs()
{

View File

@@ -125,6 +125,7 @@ class GcUpgradeLogDialog : public QDialog
public:
GcUpgradeLogDialog(QDir);
~GcUpgradeLogDialog();
void enableButtons();
void append(QString, int level=0);

View File

@@ -154,6 +154,11 @@ GcCrashDialog::GcCrashDialog(QDir homeDir) : QDialog(NULL, Qt::Dialog), home(hom
setHTML();
}
GcCrashDialog::~GcCrashDialog()
{
if (report) delete report->page();
}
QString GcCrashDialog::versionHTML()
{
// -- OS ----

View File

@@ -35,6 +35,7 @@ class GcCrashDialog : public QDialog
public:
GcCrashDialog(QDir);
~GcCrashDialog();
AthleteDirectoryStructure home;
static QString versionHTML();

View File

@@ -131,6 +131,7 @@ void LiveMapWebPageWindow::userUrl()
LiveMapWebPageWindow::~LiveMapWebPageWindow()
{
if (view) delete view->page();
}
void LiveMapWebPageWindow::ergFileSelected(ErgFile* f)

View File

@@ -181,6 +181,7 @@ WebPageWindow::WebPageWindow(Context *context) : GcChartWindow(context), context
WebPageWindow::~WebPageWindow()
{
if (view) delete view->page();
}
void