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 /framework/source/dispatch/closedispatcher.cxx | |
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 'framework/source/dispatch/closedispatcher.cxx')
-rw-r--r-- | framework/source/dispatch/closedispatcher.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx index eedefcd36da5..afab7e871798 100644 --- a/framework/source/dispatch/closedispatcher.cxx +++ b/framework/source/dispatch/closedispatcher.cxx @@ -71,9 +71,9 @@ CloseDispatcher::CloseDispatcher(const css::uno::Reference< css::uno::XComponent uno::Reference<awt::XWindow> xWindow = xTarget->getContainerWindow(); if (xWindow.is()) { - vcl::Window* pWindow = VCLUnoHelper::GetWindow(xWindow); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xWindow); if (pWindow->IsSystemWindow()) - m_pSysWindow = dynamic_cast<SystemWindow*>(pWindow); + m_pSysWindow = dynamic_cast<SystemWindow*>(pWindow.get()); } } @@ -603,7 +603,7 @@ css::uno::Reference< css::frame::XFrame > CloseDispatcher::static_impl_searchRig // Because sometimes VCL create "implicit border windows" as parents even we created // a simple XWindow using the toolkit only .-( SolarMutexGuard aSolarLock; - vcl::Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( (pWindow ) && (pWindow->IsSystemWindow()) |