<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Andreas Pakulat wrote:
<blockquote cite="mid20061115093017.GA5443@morpheus.apaku.dnsalias.org"
type="cite">
<pre wrap="">On 14.11.06 13:42:29, Matt Chambers wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I'm dynamically creating a context menu for a QTableView, populated with some
QActions. Everytime
I right click, the menu is created. Over time, hundreds of these closed menus
will set in memory, along
with all the qactions, assoctated icons and text, ect. When I close the app, I
see all of them destroyed.
Is there a way to have a qmenu clean up after itself after it closes?
</pre>
</blockquote>
<pre wrap=""><!---->
Sure, remove all references to it and the python garbage collector will
delete it. This means that you shouldn't set the menu as a member of
your QTableView subclass but only create it inside the context-menu
function as a local instance.
Andreas
</pre>
</blockquote>
Maybe I was doing it wrong. I was running menu.popup(). When I
switched the menu.exec_() everything<br>
was garbaged collected properly. I didn't make any other changes.<br>
<br>
<br>
</body>
</html>