summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorThomas Lange [tl] <tl@openoffice.org>2010-06-28 13:58:27 +0200
committerThomas Lange [tl] <tl@openoffice.org>2010-06-28 13:58:27 +0200
commit7cf95e512b371281073de2422aa30c5d3c35a3c0 (patch)
tree9b2b931ebbd1d66165ea00d5dff09c4435eb8c9f /sfx2
parent271727322f844a8b56d5f3054f0eb61a7e1484a9 (diff)
cws tl81: #i112695# crash in synonym sub-menu fixed
Diffstat (limited to 'sfx2')
-rwxr-xr-xsfx2/source/menu/mnumgr.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
index b264a5b47861..bc765b95340c 100755
--- a/sfx2/source/menu/mnumgr.cxx
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -578,6 +578,7 @@ SfxPopupMenuManager* SfxPopupMenuManager::Popup( const ResId& rResId, SfxViewFra
return 0;
}
+
void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFrame, const Point& rPoint, Window* pWindow )
{
PopupMenu *pSVMenu = new PopupMenu( rResId );
@@ -622,6 +623,12 @@ void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFram
SfxPopupMenuManager aPop( pSVMenu, pFrame->GetBindings() );
aPop.RemoveDisabledEntries();
aPop.Execute( rPoint, pWindow );
+
+ // #i112646 avoid crash when context menu is closed.
+ // the (manually inserted) sub-menu needs to be destroyed before
+ // aPop gets destroyed.
+ delete pThesSubMenu;
+ pThesSubMenu = 0;
}
delete pThesSubMenu;
@@ -631,3 +638,4 @@ Menu* SfxPopupMenuManager::GetSVMenu()
{
return (Menu*) GetMenu()->GetSVMenu();
}
+