diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-10 12:53:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-11 06:55:41 +0000 |
commit | 78b4a1fb01af9ad3b3395a22f6e396be914b553e (patch) | |
tree | 846fdaea907a70fdc274a1e76642ed5e06622c0d /sfx2/source/dialog | |
parent | 071e23fee07b92b8f07800cda3ca7e66afe818ae (diff) |
update vclwidget loplugin to find ref-dropping assigment
Look for places where we are accidentally assigning a returned-by-value
VclPtr<T> to a T*, which generally ends up in a use-after-free.
Change-Id: I4f361eaca88820cdb7aa3b8340212db61580fdd9
Reviewed-on: https://gerrit.libreoffice.org/30749
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r-- | sfx2/source/dialog/backingcomp.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/dockwin.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/mailmodel.cxx | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx index 43f018de78b5..0e53109a83d3 100644 --- a/sfx2/source/dialog/backingcomp.cxx +++ b/sfx2/source/dialog/backingcomp.cxx @@ -700,7 +700,7 @@ void SAL_CALL BackingComp::initialize( /*IN*/ const css::uno::Sequence< css::uno } // create the component window - vcl::Window* pParent = VCLUnoHelper::GetWindow(xParentWindow); + VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow(xParentWindow); VclPtr<vcl::Window> pWindow = VclPtr<BackingWindow>::Create(pParent); m_xWindow = VCLUnoHelper::GetInterface(pWindow); @@ -772,8 +772,8 @@ void SAL_CALL BackingComp::dispatch( const css::util::URL& aURL, const css::uno: // vnd.org.libreoffice.recentdocs:ClearRecentFileList - clear recent files if ( aURL.Path == "ClearRecentFileList" ) { - vcl::Window* pWindow = VCLUnoHelper::GetWindow(m_xWindow); - BackingWindow* pBack = dynamic_cast<BackingWindow*>(pWindow ); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(m_xWindow); + BackingWindow* pBack = dynamic_cast<BackingWindow*>(pWindow.get()); if( pBack ) { pBack->clearRecentFileList(); diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 76c41d2ac048..a51397d07906 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -197,7 +197,7 @@ SfxDockingWrapper::SfxDockingWrapper( vcl::Window* pParentWnd , { } - vcl::Window* pContentWindow = VCLUnoHelper::GetWindow(xWindow); + VclPtr<vcl::Window> pContentWindow = VCLUnoHelper::GetWindow(xWindow); if ( pContentWindow ) pContentWindow->SetStyle( pContentWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL ); pTitleDockWindow->SetWrappedWindow(pContentWindow); diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index e9bc1be90f0e..d7d2b55d3984 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -821,7 +821,7 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css: css::uno::Reference< css::awt::XWindow > xParentWindow = xFrame->getContainerWindow(); SolarMutexGuard aGuard; - vcl::Window* pParentWindow = VCLUnoHelper::GetWindow( xParentWindow ); + VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow( xParentWindow ); ScopedVclPtrInstance< MessageDialog > aBox(pParentWindow, "ErrorFindEmailDialog", "sfx/ui/errorfindemaildialog.ui"); aBox->Execute(); |