summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2011-05-17 14:29:14 +0200
committerDavid Tardon <dtardon@redhat.com>2011-05-18 06:05:44 +0200
commit6412ba57b3759d78a3cce05a985e7ce1f084667e (patch)
tree60e20a9a509362bea295a9fe907556b6ab4fedab /sfx2
parent2de65f1c733a27ac8cf59ea0fc232d7984edcc8e (diff)
do not leak memory
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/templdlg.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 21ca852d547e..ddebea60add1 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -29,6 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sfx2.hxx"
+#include <boost/scoped_ptr.hpp>
+
#include <vcl/menu.hxx>
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
@@ -2562,7 +2564,7 @@ IMPL_LINK( SfxTemplateDialog_Impl, ToolBoxRClick, ToolBox *, pBox )
TIB_DROPDOWN == (pBox->GetItemBits(nEntry)&TIB_DROPDOWN))
{
//create a popup menu in Writer
- PopupMenu *pMenu = new PopupMenu;
+ boost::scoped_ptr<PopupMenu> pMenu(new PopupMenu);
uno::Reference< container::XNameAccess > xNameAccess(
::comphelper::getProcessServiceFactory()->
createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
@@ -2607,7 +2609,6 @@ IMPL_LINK( SfxTemplateDialog_Impl, ToolBoxRClick, ToolBox *, pBox )
catch(uno::Exception&)
{
}
- delete pMenu;
pBox->Invalidate();
}
return 0;