diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-03-06 16:06:40 +0600 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-03-11 04:43:28 +0100 |
commit | 1ac5353bbb25bd9ff0ab0e157b3dbd0da325480a (patch) | |
tree | 540dc6574b0d1b2e67afee3d670b8805493f28fa /include/sot/storage.hxx | |
parent | e2bfc34d146806a8f96be0cd2323d716f12cba4e (diff) |
Use weak reference to SfxObjectShell in SfxEventHint to avoid use-after-free
The events may be processed after the shell has been destroyed. This is
happening reliably after commit e2bfc34d146806a8f96be0cd2323d716f12cba4e
(Reimplement OleComponentNative_Impl to use IGlobalInterfaceTable,
2024-03-11) when controlling LibreOffice from external Java scripts; but
obviously, it could happen before as well.
Now SotObject inherits from cppu::OWeakObject, instead of SvRefBase.
Change-Id: I73a3531499a3068c801c98f40de39bdf8ad90b2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164458
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'include/sot/storage.hxx')
-rw-r--r-- | include/sot/storage.hxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/sot/storage.hxx b/include/sot/storage.hxx index ac11340ac26d..2a49b4a39475 100644 --- a/include/sot/storage.hxx +++ b/include/sot/storage.hxx @@ -142,9 +142,9 @@ public: // create stream with connection to Storage, // more or less a Parent-Child relationship - tools::SvRef<SotStorageStream> OpenSotStream(const OUString & rEleName, + rtl::Reference<SotStorageStream> OpenSotStream(const OUString & rEleName, StreamMode = StreamMode::STD_READWRITE); - SotStorage* OpenSotStorage(const OUString & rEleName, + rtl::Reference<SotStorage> OpenSotStorage(const OUString & rEleName, StreamMode = StreamMode::STD_READWRITE, bool transacted = true); @@ -161,7 +161,7 @@ public: static bool IsOLEStorage(const OUString & rFileName); static bool IsOLEStorage(SvStream* pStream); - static SotStorage* OpenOLEStorage(css::uno::Reference<css::embed::XStorage> const & xStorage, + static rtl::Reference<SotStorage> OpenOLEStorage(css::uno::Reference<css::embed::XStorage> const & xStorage, OUString const & rEleName, StreamMode = StreamMode::STD_READWRITE); static SotClipboardFormatId GetFormatID(css::uno::Reference<css::embed::XStorage> const & xStorage); static sal_Int32 GetVersion(css::uno::Reference<css::embed::XStorage> const & xStorage); |