QString TabWidget::webEngineDefaultUserAgent = QLatin1String("");
// Construct the class.
-TabWidget::TabWidget(QWidget *parent) : QWidget(parent)
+TabWidget::TabWidget(QWidget *windowPointer) : QWidget(windowPointer)
{
// Create a QProcess to check if KDE is running.
QProcess *checkIfRunningKdeQProcessPointer = new QProcess();
// Set the loading favorite icon movie file name.
loadingFavoriteIconMoviePointer->setFileName(QStringLiteral(":/icons/loading.gif"));
+ // Stop the loading favorite icon movie if the window is destroyed. Otherwise, the app will crash if there is more than one window open and a window is closed while at tab is loading.
+ connect(windowPointer, SIGNAL(destroyed()), this, SLOT(stopLoadingFavoriteIconMovie()));
+
// Add the first tab.
addFirstTab();
emit linkHovered(linkUrl);
}
+void TabWidget::stopLoadingFavoriteIconMovie() const
+{
+ // Stop the loading favorite icon movie. Otherwise, the browser will crash if a second window is closed while a tab in it is loading. <https://redmine.stoutner.com/issues/1010>
+ loadingFavoriteIconMoviePointer->stop();
+}
+
void TabWidget::print() const
{
// Create a printer.