include/toolkit/awt/vclxmenu.hxx | 2 ++ toolkit/source/awt/vclxmenu.cxx | 2 ++ 2 files changed, 4 insertions(+)
New commits: commit 709b1f3ddb87303a2dec6155dbe0106369c151ed Author: Stephan Bergmann <[email protected]> AuthorDate: Thu Nov 7 08:44:28 2024 +0100 Commit: Stephan Bergmann <[email protected]> CommitDate: Thu Nov 7 11:53:29 2024 +0100 Make sure VCLXPopupMenu has unique RTTI ...by providing a non-inline key function for that class. This would have prevented the issue that has been addressed by 2fe53b2e436cb236b2dc121ceec4f22de49a13a8 "Fix crash due to unexpected dynamic_cast failures in optimized build", where a dynamic_cast to VCLXPopupMenu failed on macOS (which uses pointer equivalence to determine RTTI equivalence), because VCLXPopupMenu is final, so the compiler, at least in optimized builds, just used a comparison between the object's recorded RTTI (from dylib A) against the type's RTTI in dylib B, which erroneously failed. Change-Id: I68ff864c266bf28d19032527f91de592ca1437f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176188 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/include/toolkit/awt/vclxmenu.hxx b/include/toolkit/awt/vclxmenu.hxx index 3498e8dabe57..05275f7e1ab6 100644 --- a/include/toolkit/awt/vclxmenu.hxx +++ b/include/toolkit/awt/vclxmenu.hxx @@ -149,6 +149,8 @@ class TOOLKIT_DLLPUBLIC VCLXPopupMenu final : public VCLXMenu public: VCLXPopupMenu(); VCLXPopupMenu( PopupMenu* pPopMenu ); + + ~VCLXPopupMenu() override; }; #endif // INCLUDED_TOOLKIT_AWT_VCLXMENU_HXX diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index 192c3ab9d346..14cd09d60514 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -880,6 +880,8 @@ VCLXPopupMenu::VCLXPopupMenu( PopupMenu* pPopMenu ) : VCLXMenu( static_cast<Menu ImplAddListener(); } +VCLXPopupMenu::~VCLXPopupMenu() = default; + extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * stardiv_Toolkit_VCLXPopupMenu_get_implementation( css::uno::XComponentContext *,
