Skip to content

Commit

Permalink
Prevent Generation of Crashdumps When the Browser Is Closed (#4667)
Browse files Browse the repository at this point in the history
* fix: extension process generating crashdumps

* fix: move `getApp` call

* chore: remove distracting comments

* chore: add changelog entry
  • Loading branch information
Nerixyz authored Jun 4, 2023
1 parent 6681ed5 commit f306e28
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Minor: Add an icon showing when streamer mode is enabled (#4410)
- Minor: Added `/shoutout <username>` commands to shoutout specified user. (#4638)
- Minor: Improved editing hotkeys. (#4628)
- Bugfix: Fixed generation of crashdumps by the browser-extension process when the browser was closed. (#4667)
- Dev: Added command to set Qt's logging filter/rules at runtime (`/c2-set-logging-rules`). (#4637)
- Dev: Added the ability to see & load custom themes from the Themes directory. No stable promises are made of this feature, changes might be made that breaks custom themes without notice. (#4570)
- Dev: Added test cases for emote and tab completion. (#4644)
Expand Down
1 change: 1 addition & 0 deletions src/BrowserExtension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ namespace {

client.sendMessage(data);
}
_Exit(0);
}
} // namespace

Expand Down
6 changes: 2 additions & 4 deletions src/singletons/NativeMessaging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ void NativeMessagingServer::ReceiverThread::run()
void NativeMessagingServer::ReceiverThread::handleMessage(
const QJsonObject &root)
{
auto app = getApp();
QString action = root.value("action").toString();

if (action.isNull())
Expand Down Expand Up @@ -237,6 +236,8 @@ void NativeMessagingServer::ReceiverThread::handleMessage(
if (_type == "twitch")
{
postToThread([=] {
auto *app = getApp();

if (!name.isEmpty())
{
auto channel = app->twitch->getOrAddChannel(name);
Expand All @@ -249,15 +250,12 @@ void NativeMessagingServer::ReceiverThread::handleMessage(
if (attach || attachFullscreen)
{
#ifdef USEWINSDK
// if (args.height != -1) {
auto *window =
AttachedWindow::get(::GetForegroundWindow(), args);
if (!name.isEmpty())
{
window->setChannel(app->twitch->getOrAddChannel(name));
}
// }
// window->show();
#endif
}
});
Expand Down

0 comments on commit f306e28

Please sign in to comment.