include/vcl/weldutils.hxx |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit a65d126a2f68c1a157d4eee1090620b82da6e575
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Dec 18 22:08:16 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Dec 20 20:08:49 2021 +0100

    use cppu::BaseMutex in TransportAsXWindow
    
    because passing a ref of a local member to a parent class
    means passing uninitialised data
    
    Change-Id: Iec76a614d99f16b34f0fd5208a7f074153d57003
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127120
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/vcl/weldutils.hxx b/include/vcl/weldutils.hxx
index a9dfa3624f7b..a11ab6c9f283 100644
--- a/include/vcl/weldutils.hxx
+++ b/include/vcl/weldutils.hxx
@@ -16,6 +16,7 @@
 #include <com/sun/star/frame/XStatusListener.hpp>
 #include <com/sun/star/uno/Reference.hxx>
 #include <comphelper/interfacecontainer2.hxx>
+#include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/compbase.hxx>
 #include <tools/time.hxx>
 #include <vcl/dllapi.h>
@@ -35,10 +36,9 @@ namespace weld
 {
 typedef cppu::WeakComponentImplHelper<css::awt::XWindow> 
TransportAsXWindow_Base;
 
-class VCL_DLLPUBLIC TransportAsXWindow : public TransportAsXWindow_Base
+class VCL_DLLPUBLIC TransportAsXWindow : public cppu::BaseMutex, public 
TransportAsXWindow_Base
 {
 private:
-    osl::Mutex m_aHelperMtx;
     weld::Widget* m_pWeldWidget;
     weld::Builder* m_pWeldWidgetBuilder;
 
@@ -51,15 +51,15 @@ private:
 
 public:
     TransportAsXWindow(weld::Widget* pWeldWidget, weld::Builder* 
pWeldWidgetBuilder = nullptr)
-        : TransportAsXWindow_Base(m_aHelperMtx)
+        : TransportAsXWindow_Base(m_aMutex)
         , m_pWeldWidget(pWeldWidget)
         , m_pWeldWidgetBuilder(pWeldWidgetBuilder)
-        , m_aWindowListeners(m_aHelperMtx)
-        , m_aKeyListeners(m_aHelperMtx)
-        , m_aFocusListeners(m_aHelperMtx)
-        , m_aMouseListeners(m_aHelperMtx)
-        , m_aMotionListeners(m_aHelperMtx)
-        , m_aPaintListeners(m_aHelperMtx)
+        , m_aWindowListeners(m_aMutex)
+        , m_aKeyListeners(m_aMutex)
+        , m_aFocusListeners(m_aMutex)
+        , m_aMouseListeners(m_aMutex)
+        , m_aMotionListeners(m_aMutex)
+        , m_aPaintListeners(m_aMutex)
     {
     }
 

Reply via email to