summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-10 12:53:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-11-11 06:55:41 +0000
commit78b4a1fb01af9ad3b3395a22f6e396be914b553e (patch)
tree846fdaea907a70fdc274a1e76642ed5e06622c0d /extensions
parent071e23fee07b92b8f07800cda3ca7e66afe818ae (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 'extensions')
-rw-r--r--extensions/source/bibliography/bibload.cxx2
-rw-r--r--extensions/source/bibliography/framectr.cxx2
-rw-r--r--extensions/source/bibliography/general.cxx4
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx2
4 files changed, 5 insertions, 5 deletions
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx
index 6144d9ef0ff1..c48bbe5b960e 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -270,7 +270,7 @@ void BibliographyLoader::loadView(const Reference< XFrame > & rFrame, const OUSt
VCLXWindow* pParentComponent = VCLXWindow::GetImplementation(aWindow);
assert(pParentComponent);
- vcl::Window* pParent = VCLUnoHelper::GetWindow( aWindow );
+ VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( aWindow );
VclPtrInstance<BibBookContainer> pMyWindow( pParent );
pMyWindow->Show();
diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx
index f07e61b156e1..c1979822dea3 100644
--- a/extensions/source/bibliography/framectr.cxx
+++ b/extensions/source/bibliography/framectr.cxx
@@ -404,7 +404,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
if ( !bDisposing )
{
::SolarMutexGuard aGuard;
- vcl::Window* pParent = VCLUnoHelper::GetWindow( xWindow );
+ VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( xWindow );
WaitObject aWaitObject( pParent );
OUString aCommand( _rURL.Path);
diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx
index 1cc434f8c0d9..c963356cc0be 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -502,7 +502,7 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl(
xCtrWin->setVisible( true );
xControl->setDesignMode( true );
- vcl::Window* pWindow = VCLUnoHelper::GetWindow(xControl->getPeer());
+ VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xControl->getPeer());
pWindow->set_grid_top_attach(rLabel.get_grid_top_attach());
pWindow->set_grid_left_attach(rLabel.get_grid_left_attach()+1);
pWindow->set_valign(VclAlign::Center);
@@ -658,7 +658,7 @@ bool BibGeneralPage::HandleShortCutKey( const KeyEvent& rKeyEvent )
uno::Reference< awt::XControl > xControl( aControls[ nCtrlIndex ], UNO_QUERY );
DBG_ASSERT( xControl.is(), "-BibGeneralPage::HandleShortCutKey(): a control which is not a control!" );
- vcl::Window* pWindow = VCLUnoHelper::GetWindow( xControl->getPeer() );
+ VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xControl->getPeer() );
if( pWindow )
{
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index ae1f136a93cd..43fdf3ed956e 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2705,7 +2705,7 @@ namespace pcr
if ( !fnCreatePage )
throw RuntimeException(); // caught below
- SfxTabPage* pPage = (*fnCreatePage)( xDialog->get_content_area(), &aCoreSet );
+ VclPtr<SfxTabPage> pPage = (*fnCreatePage)( xDialog->get_content_area(), &aCoreSet );
xDialog->SetTabPage( pPage );
_rClearBeforeDialog.clear();