diff options
author | Noel Grandin <noel@peralex.com> | 2016-04-18 11:21:44 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-04-18 10:51:54 +0000 |
commit | 67d333c608a662621c1069aacdec75e45e33a183 (patch) | |
tree | 9b2715c5d159acc881627fe461c501fd4db91abf /vcl/source | |
parent | 0c1e6136ca84ec3bd2c0bb96689c0235b8585b25 (diff) |
tdf#99352 - Some VclPtrs leak past DeInitVCL
Change-Id: I74b27b1d8b662a644df580ae128643b8495355f8
Reviewed-on: https://gerrit.libreoffice.org/24204
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/winproc.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 062136e363de..fe5286de3a99 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -36,6 +36,7 @@ #include <vcl/dockwin.hxx> #include <vcl/menu.hxx> #include <vcl/virdev.hxx> +#include <vcl/lazydelete.hxx> #include <touch/touch.h> #include <svdata.hxx> @@ -1473,7 +1474,7 @@ public: bool HandleWheelEvent::HandleEvent(const SalWheelMouseEvent& rEvt) { static SalWheelMouseEvent aPreviousEvent; - static VclPtr<vcl::Window> xPreviousWindow; + static vcl::DeleteOnDeinit< VclPtr<vcl::Window> > xPreviousWindow( new VclPtr<vcl::Window> ); if (!Setup()) return false; @@ -1483,16 +1484,17 @@ bool HandleWheelEvent::HandleEvent(const SalWheelMouseEvent& rEvt) // avoid the problem that scrolling via wheel to this point brings a widget // under the mouse that also accepts wheel commands, so stick with the old // widget if the time gap is very small - if (shouldReusePreviousMouseWindow(aPreviousEvent, rEvt) && acceptableWheelScrollTarget(xPreviousWindow)) + VclPtr<vcl::Window> tmp = *xPreviousWindow.get(); + if (shouldReusePreviousMouseWindow(aPreviousEvent, rEvt) && acceptableWheelScrollTarget(tmp)) { - xMouseWindow = xPreviousWindow.get(); + xMouseWindow = tmp; } aPreviousEvent = rEvt; - xPreviousWindow = Dispatch(xMouseWindow); + (*xPreviousWindow.get()) = Dispatch(xMouseWindow); - return xPreviousWindow; + return *xPreviousWindow.get(); } class HandleGestureEvent : public HandleGestureEventBase |