summaryrefslogtreecommitdiff
path: root/vcl/osx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-08 14:27:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-09 13:12:30 +0200
commitb7abdafcfc42722ab060529864a2109d1e4198c0 (patch)
tree9709bb6dfd778d7af797d9351ff293a5fba41e40 /vcl/osx
parent6d008c9e1dbe4240a10c8789860dc30b0cb0b2d5 (diff)
return and hold SalMenuItem by std::unique_ptr
and drop DestroyMenuItem, all the implementations were just deleting the pointer Change-Id: I058817b963988b1e399279f61f45716a2cdba023 Reviewed-on: https://gerrit.libreoffice.org/55500 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/osx')
-rw-r--r--vcl/osx/salmenu.cxx14
1 files changed, 3 insertions, 11 deletions
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index c12eb41c236f..ff400fdd4810 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -233,19 +233,11 @@ void AquaSalInstance::DestroyMenu( SalMenu* pSalMenu )
delete pSalMenu;
}
-SalMenuItem* AquaSalInstance::CreateMenuItem( const SalItemParams* pItemData )
+std::unique_ptr<SalMenuItem> AquaSalInstance::CreateMenuItem( const SalItemParams & rItemData )
{
- if( !pItemData )
- return nullptr;
+ AquaSalMenuItem *pSalMenuItem = new AquaSalMenuItem( &rItemData );
- AquaSalMenuItem *pSalMenuItem = new AquaSalMenuItem( pItemData );
-
- return pSalMenuItem;
-}
-
-void AquaSalInstance::DestroyMenuItem( SalMenuItem* pSalMenuItem )
-{
- delete pSalMenuItem;
+ return std::unique_ptr<SalMenuItem>(pSalMenuItem);
}
/*