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
Attachments
For Gerrit Dashboard: PYSIDE-340 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
167194,3 | Do not add reference to QMenu in QToolButton::setMenu() | dev | pyside/pyside-setup | Status: MERGED | -2 | 0 |