-
-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanly exit Chatterino instead of force exiting #4993
Conversation
Needs some more testing, specifically on:
|
This currently causes a call to std::terminate on Windows, the following fixed it: diff --git a/src/providers/liveupdates/BasicPubSubManager.hpp b/src/providers/liveupdates/BasicPubSubManager.hpp
index f82f70363..3a61ee8fe 100644
--- a/src/providers/liveupdates/BasicPubSubManager.hpp
+++ b/src/providers/liveupdates/BasicPubSubManager.hpp
@@ -94,7 +94,10 @@ public:
.toStdString());
}
- virtual ~BasicPubSubManager() = default;
+ virtual ~BasicPubSubManager()
+ {
+ this->stop();
+ }
BasicPubSubManager(const BasicPubSubManager &) = delete;
BasicPubSubManager(const BasicPubSubManager &&) = delete; We should make sure the app always eventually exits (not like in the tests some time ago, where the Qt event-loop wouldn't spin). I wanted to add the option to restart Chatterino on a crash back to Windows soon, so we should also ensure that we don't abort/terminate/crash when exiting. |
Co-authored-by: pajlada <[email protected]>
Tested closing on Windows with the browser extension attached, and had no issues |
TwitchIrcServer contains the channels, and they now live longer than the windows themselves. I made it so the dtor of WindowManager *actually* deletes the windows now - i.e. them and everything in them are destroyed.
mini memory leak fix
New commit has been tested on i3 & macOS Only thing I notice is that 7tv's eventapi takes a while to close |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
Latest commit tested on i3 & macOS - works as expected & shuts down pretty fast |
I think I would prefer to do smaller steps towards removing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops wrong pr :tf:
Closing in favour of #5537 |
Description
Joining the thread stops us from crashing.
Known issues relating to this:
_exit
.