klipper: fix potential memory leak from action menu

Reason for the change

  • klipper: fix potential memory leak from action menu

m_myMenu is only deleted when the timer reaches timeout, so when m_myMenu is not null but a new action menu is invoked in URLGrabber::actionMenu, the old QMenu object is leaked.

QAction in the menu also has a wrong lifetime. Its parent should be the menu instead of URLGrabber, which is always alive when klipper is active.

Test plan

Screenshots or screen recordings

Bugs fixed

Edited by Fushan Wen

Merge request reports

Loading