https://bugs.kde.org/show_bug.cgi?id=500322

--- Comment #6 from Guilherme Silva <[email protected]> ---
I was getting a bit tired of seeing Proton Mail Bridge crash every time when
exiting, so I asked ChatGPT for help analyzing the gdb backtrace, due to my
incompetence with C++/Qt.

To keep things short, ChatGPT determined that the culprit of the crash is
Proton Mail Bridge itself. Though I still don't understand why it doesn't crash
under a COSMIC session, as I reported in
https://bugs.kde.org/show_bug.cgi?id=500563.

Anyway, after a little back and forth, ChatGPT suggested me to add this code in
Proton Mail Bridge's QMLBackend::init() [1]:

// make sure the tray icon is destroyed before QApplication dtor
connect(qApp, &QCoreApplication::aboutToQuit, this, [this] {
    trayIcon_.reset();
});

So I added that after line 67, rebuilt and repackeged the Proton Mail Bridge,
and sure enough, it stopped crashing after exiting!

I'd send a pull request to Proton Mail Bridge, but I don't feel confident
enough to send PRs for stuff I didn't come up myself. But if anyone reading
this wants to do that, please go ahead.

It'd be great if KStatusNotifierItem could prevent this crash somehow, but I
have no clue if that's even possible.

[1]
https://github.com/ProtonMail/proton-bridge/blob/e9ea976773c7d78866c32bd5bce669400283bdc0/internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp#L62

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to