fix: better handle Windows shutting down in newer Qt versions (#6368)
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
- Bugfix: Fixed a crash that could occur an eventsub connection's keepalive timer would run after the connection was dead, causing the keepalive timer to use-itself-after-free. (#6204)
|
||||
- Bugfix: Fixed a crash that could occur when an image started loading mid app shutdown. (#6213)
|
||||
- Bugfix: Fixed a crash that could occur on exit if a ping played less than 30 seconds prior. (#6332)
|
||||
- Bugfix: Fixed a crash that could occur on exit on newer versions of Qt. (#6368)
|
||||
- Bugfix: Fixed notebook buttons (settings, account switcher, streamer mode) not performing a relayout when their visibility changed, causing a gap until resize. Linux / macOS only. (#6328)
|
||||
- Bugfix: Fixed some minor typos. (#6196)
|
||||
- Bugfix: Fixed inconsistent spaces in messages when using fractional scaling. (#6231, #6254)
|
||||
|
||||
@@ -607,6 +607,8 @@ void Application::aboutToQuit()
|
||||
|
||||
this->hotkeys->save();
|
||||
this->windows->save();
|
||||
|
||||
this->windows->closeAll();
|
||||
}
|
||||
|
||||
void Application::stop()
|
||||
|
||||
@@ -350,7 +350,7 @@ Window &WindowManager::createWindow(WindowType type, bool show, QWidget *parent)
|
||||
{
|
||||
window->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
QObject::connect(window, &QWidget::destroyed, [this, window] {
|
||||
QObject::connect(window, &QWidget::destroyed, this, [this, window] {
|
||||
for (auto it = this->windows_.begin(); it != this->windows_.end();
|
||||
it++)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "widgets/splits/SplitContainer.hpp"
|
||||
|
||||
#include <pajlada/settings/settinglistener.hpp>
|
||||
#include <QObject>
|
||||
#include <QPoint>
|
||||
#include <QTimer>
|
||||
|
||||
@@ -36,8 +37,10 @@ enum class WindowType;
|
||||
enum class SettingsDialogPreference;
|
||||
class FramelessEmbedWindow;
|
||||
|
||||
class WindowManager final
|
||||
class WindowManager final : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Theme &themes;
|
||||
const Args &appArgs;
|
||||
|
||||
|
||||
+12
-3
@@ -153,10 +153,19 @@ bool Window::event(QEvent *event)
|
||||
|
||||
void Window::closeEvent(QCloseEvent *)
|
||||
{
|
||||
if (isAppAboutToQuit())
|
||||
{
|
||||
qCWarning(chatterinoWidget)
|
||||
<< "Window closeEvent ran when Application is already dead";
|
||||
return;
|
||||
}
|
||||
|
||||
auto *app = getApp();
|
||||
|
||||
if (this->type_ == WindowType::Main)
|
||||
{
|
||||
getApp()->getWindows()->save();
|
||||
getApp()->getWindows()->closeAll();
|
||||
app->getWindows()->save();
|
||||
app->getWindows()->closeAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -167,7 +176,7 @@ void Window::closeEvent(QCloseEvent *)
|
||||
// Ensure selectedWindow_ is never an invalid pointer.
|
||||
// WindowManager will return the main window if no window is pointed to by
|
||||
// `selectedWindow_`.
|
||||
getApp()->getWindows()->selectedWindow_ = nullptr;
|
||||
app->getWindows()->selectedWindow_ = nullptr;
|
||||
|
||||
this->closed.invoke();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user