mirror of
https://github.com/Chatterino/chatterino2.git
synced 2026-08-24 10:04:53 -05:00
uh maybe
This commit is contained in:
@@ -607,6 +607,8 @@ void Application::aboutToQuit()
|
||||
|
||||
this->hotkeys->save();
|
||||
this->windows->save();
|
||||
|
||||
this->windows->closeAll();
|
||||
}
|
||||
|
||||
void Application::stop()
|
||||
@@ -664,6 +666,9 @@ void Application::initNm(const Paths &paths)
|
||||
IApplication *getApp()
|
||||
{
|
||||
assert(INSTANCE != nullptr);
|
||||
if (STOPPED.load() == true) {
|
||||
__debugbreak();
|
||||
}
|
||||
assert(STOPPED.load() == false);
|
||||
|
||||
return INSTANCE;
|
||||
|
||||
@@ -151,12 +151,15 @@ bool Window::event(QEvent *event)
|
||||
return BaseWindow::event(event);
|
||||
}
|
||||
|
||||
void Window::closeEvent(QCloseEvent *)
|
||||
void Window::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
auto *app = tryGetApp();
|
||||
assert(app != nullptr);
|
||||
|
||||
if (this->type_ == WindowType::Main)
|
||||
{
|
||||
getApp()->getWindows()->save();
|
||||
getApp()->getWindows()->closeAll();
|
||||
app->getWindows()->save();
|
||||
app->getWindows()->closeAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -167,7 +170,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