From 09b667d155e8ea6963ede60ae5860952af20de4f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 2 Sep 2014 11:26:34 +0100 Subject: widget leak on filling non-existing infobar in help Window () with live children destroyed: PushButton (Edit document) Change-Id: I2aa05f59f08cfa78ba895933ef298908a9cbb675 --- sfx2/source/view/viewfrm.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sfx2') diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 40d4b67603b0..1e70bd693330 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -3346,6 +3346,14 @@ void SfxViewFrame::AppendInfoBar( const OUString& sId, const OUString& sMessage, pInfoBars->appendInfoBar( sId, sMessage, aButtons ); ShowChildWindow( nId ); } + else + { + SAL_WARN( "sfx.view", "No consumer for InfoBar buttons, so deleting them instead" ); + for (std::vector< PushButton* >::iterator it = aButtons.begin(); it != aButtons.end(); ++it) + { + delete *it; + } + } } void SfxViewFrame::RemoveInfoBar( const OUString& sId ) -- cgit