mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(systemtrayicon): only delete the systray backend that was used
Fixes qTox not closing cleanly after
4fd0446f96
This commit is contained in:
parent
01c56a3af6
commit
1d6f32c9f9
|
@ -99,19 +99,33 @@ SystemTrayIcon::SystemTrayIcon()
|
|||
|
||||
SystemTrayIcon::~SystemTrayIcon()
|
||||
{
|
||||
// only delete the used backend
|
||||
switch(backendType)
|
||||
{
|
||||
case SystrayBackendType::Qt:
|
||||
delete qtIcon;
|
||||
break;
|
||||
#ifdef ENABLE_SYSTRAY_UNITY_BACKEND
|
||||
case SystrayBackendType::Unity:
|
||||
delete unityIndicator;
|
||||
delete unityMenu;
|
||||
break;
|
||||
#endif
|
||||
#ifdef ENABLE_SYSTRAY_STATUSNOTIFIER_BACKEND
|
||||
case SystrayBackendType::StatusNotifier:
|
||||
delete statusNotifier;
|
||||
delete snMenu;
|
||||
break;
|
||||
#endif
|
||||
#ifdef ENABLE_SYSTRAY_GTK_BACKEND
|
||||
case SystrayBackendType::GTK:
|
||||
delete gtkIcon;
|
||||
delete gtkMenu;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
qWarning() << "Unknown Systray Backend Type";
|
||||
}
|
||||
qDebug() << "Deleting SystemTrayIcon";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user