//******************************************************
void NewGeom_Module::contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle)
{
- theMenu->addActions(myWorkshop->contextMenuMgr()->viewerMenu()->actions());
+ QMenu* aMenu = myWorkshop->contextMenuMgr()->viewerMenu();
+ theMenu->addActions(aMenu->actions());
//myWorkshop->contextMenuMgr()->addViewerMenu(theMenu);
LightApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
+ delete aMenu; // Delete menu because it is not controlled by menu manager
}