<table><tr><td style="">kossebau created this revision.<br />Restricted Application added a subscriber: kdevelop-devel.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D6769" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>For actions and submenus created only for the given context for the menu,<br />
as opposed to persistent context-ignorant actions kept around all the time<br />
and owned by the plugin instance, in IPlugin::contextMenuExtension()<br />
overrides was no access to a QObject/QWidget element which could be used<br />
as QObject-style memory management for the given context menu event.<br />
So the old code for that either used instances like the plugin objects<br />
themselves or even none at all, which both de-facto results in<br />
accumulating lots of out-of-use QActions and QMenus during the runtime<br />
of KDevelop, only to be cleaned up either on destruction of the plugin<br />
instances at process end or never.</p>

<p>Passing to IPlugin::contextMenuExtension a QWidget* object to be used<br />
as memory management parent matching the lifetime of the context menu<br />
allows to fix that.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Invoked the context menus changed by the patch, and the temporarily<br />
added slots connected to QObject::destroyed handlers of the<br />
per-context-menu QAction & QMenu objects were invoked at the right time.<br />
No new crashes seen.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R33 KDevPlatform</div></div></div><br /><div><strong>BRANCH</strong><div><div>fixcontextmenuleakage</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D6769" rel="noreferrer">https://phabricator.kde.org/D6769</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>interfaces/context.h<br />
interfaces/iplugin.cpp<br />
interfaces/iplugin.h<br />
interfaces/iplugincontroller.h<br />
language/codegen/basicrefactoring.cpp<br />
language/codegen/basicrefactoring.h<br />
plugins/appwizard/appwizardplugin.cpp<br />
plugins/appwizard/appwizardplugin.h<br />
plugins/bazaar/bazaarplugin.cpp<br />
plugins/bazaar/bazaarplugin.h<br />
plugins/classbrowser/classbrowserplugin.cpp<br />
plugins/classbrowser/classbrowserplugin.h<br />
plugins/classbrowser/classtree.cpp<br />
plugins/contextbrowser/contextbrowser.cpp<br />
plugins/contextbrowser/contextbrowser.h<br />
plugins/contextbrowser/contextbrowserview.cpp<br />
plugins/cvs/cvsplugin.cpp<br />
plugins/cvs/cvsplugin.h<br />
plugins/docker/dockerplugin.cpp<br />
plugins/docker/dockerplugin.h<br />
plugins/documentview/kdevdocumentview.cpp<br />
plugins/externalscript/externalscriptplugin.cpp<br />
plugins/externalscript/externalscriptplugin.h<br />
plugins/filemanager/filemanager.cpp<br />
plugins/filetemplates/filetemplatesplugin.cpp<br />
plugins/filetemplates/filetemplatesplugin.h<br />
plugins/flatpak/flatpakplugin.cpp<br />
plugins/flatpak/flatpakplugin.h<br />
plugins/grepview/grepviewplugin.cpp<br />
plugins/grepview/grepviewplugin.h<br />
plugins/openwith/openwithplugin.cpp<br />
plugins/openwith/openwithplugin.h<br />
plugins/patchreview/patchreview.cpp<br />
plugins/patchreview/patchreview.h<br />
plugins/patchreview/patchreviewtoolview.cpp<br />
plugins/perforce/perforceplugin.cpp<br />
plugins/perforce/perforceplugin.h<br />
plugins/problemreporter/problemreporterplugin.cpp<br />
plugins/problemreporter/problemreporterplugin.h<br />
plugins/projectfilter/projectfilterprovider.cpp<br />
plugins/projectfilter/projectfilterprovider.h<br />
plugins/projectmanagerview/projectbuildsetwidget.cpp<br />
plugins/projectmanagerview/projectmanagerviewplugin.cpp<br />
plugins/projectmanagerview/projectmanagerviewplugin.h<br />
plugins/projectmanagerview/projecttreeview.cpp<br />
plugins/quickopen/quickopenplugin.cpp<br />
plugins/quickopen/quickopenplugin.h<br />
plugins/subversion/kdevsvnplugin.cpp<br />
plugins/subversion/kdevsvnplugin.h<br />
plugins/switchtobuddy/switchtobuddyplugin.cpp<br />
plugins/switchtobuddy/switchtobuddyplugin.h<br />
plugins/vcschangesview/vcschangesview.cpp<br />
shell/debugcontroller.cpp<br />
shell/debugcontroller.h<br />
shell/documentationcontroller.cpp<br />
shell/documentationcontroller.h<br />
shell/plugincontroller.cpp<br />
shell/plugincontroller.h<br />
shell/projectcontroller.cpp<br />
shell/projectcontroller.h<br />
shell/runcontroller.cpp<br />
shell/runcontroller.h<br />
shell/sourceformattercontroller.cpp<br />
shell/sourceformattercontroller.h<br />
shell/textdocument.cpp<br />
tests/testplugincontroller.cpp<br />
tests/testplugincontroller.h<br />
vcs/dvcs/dvcsplugin.cpp<br />
vcs/dvcs/dvcsplugin.h<br />
vcs/vcspluginhelper.cpp<br />
vcs/vcspluginhelper.h</div></div></div><br /><div><strong>To: </strong>kossebau, KDevelop<br /><strong>Cc: </strong>kdevelop-devel<br /></div>