Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(systemtrayicon): only delete the systray backend that was used
Browse files Browse the repository at this point in the history
Fixes qTox not closing cleanly after
4fd0446
  • Loading branch information
sudden6 committed Apr 13, 2016
1 parent 01c56a3 commit 1d6f32c
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions src/widget/systemtrayicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,33 @@ SystemTrayIcon::SystemTrayIcon()

SystemTrayIcon::~SystemTrayIcon()
{
delete qtIcon;
// only delete the used backend
switch(backendType)
{
case SystrayBackendType::Qt:
delete qtIcon;
break;
#ifdef ENABLE_SYSTRAY_UNITY_BACKEND
delete unityIndicator;
delete unityMenu;
case SystrayBackendType::Unity:
delete unityIndicator;
delete unityMenu;
break;
#endif
#ifdef ENABLE_SYSTRAY_STATUSNOTIFIER_BACKEND
delete statusNotifier;
delete snMenu;
case SystrayBackendType::StatusNotifier:
delete statusNotifier;
delete snMenu;
break;
#endif
#ifdef ENABLE_SYSTRAY_GTK_BACKEND
delete gtkIcon;
delete gtkMenu;
case SystrayBackendType::GTK:
delete gtkIcon;
delete gtkMenu;
break;
#endif
default:
qWarning() << "Unknown Systray Backend Type";
}
qDebug() << "Deleting SystemTrayIcon";
}

Expand Down

0 comments on commit 1d6f32c

Please sign in to comment.