In case any others out there are being plagued by the dijit.Menu bug where it won't cleanly destroy itself -- this is a work around until they get it fixed.
Do the following after a menu closes (by attaching to "onClose" event of the menu)
dijit.byId( '/*id of menu*/' ).destroy(); //removes dijit registry entry for menu itself
//finds the orphaned menus on the body dom node and deletes the widgets.
dojo.forEach( dojo.query( ".dijitMenuTable" ).map(dijit.byNode), function( widget ){ widget.destroy(); } );
dojo.query( ".dijitPopup" ).forEach( function( domNode ) { dojo._destroyElement( domNode ); } );
//finds the orphaned menus on the body dom node and deletes the widgets.
dojo.forEach( dojo.query( ".dijitMenuTable" ).map(dijit.byNode), function( widget ){ widget.destroy(); } );
dojo.query( ".dijitPopup" ).forEach( function( domNode ) { dojo._destroyElement( domNode ); } );
Not sure this is a good enough solution to be added to Dojo itself -- because the Dojo 1.1 ToDo items state that they may redesign how the Menu is built. The real reason for the bug is that the _Widget.destroyDescendants() can not find the menus themselves that are hung off the Body dom node.
Hope this helps someone out.
-- Joseph Firebaugh
