fix tray bug

This commit is contained in:
Malte Jürgens 2023-01-14 16:28:23 +01:00
parent d6641a7a6e
commit 9f46e710a9
No known key found for this signature in database
GPG key ID: D29FBD5F93C0CFC3
2 changed files with 3 additions and 1 deletions

View file

@ -125,6 +125,8 @@ void MainWindow::setupTrayIcon() {
}
void MainWindow::cleanTrayIcon() {
if (m_trayIcon == nullptr)
return;
m_trayIcon->hide();
m_trayIconMenu->deleteLater();
m_trayIcon->deleteLater();

View file

@ -30,7 +30,7 @@ private:
QWebEngineProfile *prepareProfile();
DiscordPage *m_discordPage;
void closeEvent(QCloseEvent *event) override;
QSystemTrayIcon *m_trayIcon;
QSystemTrayIcon *m_trayIcon = nullptr;
QMenu *m_trayIconMenu;
QSettings *m_settings;
bool m_wasMaximized;