[Qt] System tray "Speed" submenu is not deleted from memory
When system tray menu is being recreated (and it happens often) it is cleared and repopulated again. This is fine for ordinary actions, but submenus are not deleted from the memory. Submenu will stay there until parent menu is deleted. This is a known issue/behavior:
https://bugreports.qt.io/browse/QTBUG-11070
It is easy to fix. Change menus.cpp#L921(https://github.com/videolan/vlc/blob/master/modules/gui/qt/menus.cpp#L921) to something like this:
for (QAction *action : sysMenu->actions()) {
if (action->menu()) {
action->menu()->deleteLater();
}
}
sysMenu->clear();
That should do the trick.
QMenu itself is not so big, but on some platform the QPA plugin is loaded. On Linux it creates DBus representation of the menu. Overall not deleted menus can accumulated taking a lot of resources.