Details
Description
QToolButton.setMenu() adds a reference to the QMenu instance but never decrease the reference counter.
import sys from PySide2.QtWidgets import * a = QToolButton() b = QMenu() print sys.getrefcount(b) # =2 a.setMenu(b) print sys.getrefcount(b) # =3 a.setMenu(None) print sys.getrefcount(b) # =3? del a del b # QMenu::~QMenu() is not invoked