Thanks for the suggestion. It didn’t fix the problem but after my last post I did find the cause of the problem: it’s a complier optimization bug. In my local release build, the problem stopped when I did a clean build and added the following in my autogen.input: --enable-optimized=no Commenting that line out and doing a clean rebuild causes the problem to reappear so it’s definitely a bug in Xcode’s variant of clang. Today I’ll try to find the right place in the code to turn off optimization like I did with a similar compiler optimization bug: https://gerrit.libreoffice.org/c/core/+/145742 Patrick > On Nov 4, 2024, at 5:31 AM, Caolán McNamara <caolan.mcnamara@xxxxxxxxxxxxx> wrote: > > No idea what is happening there, but I see that m_xPopupMenu in > include/svtools/popupmenucontrollerbase.hxx is a VCLXPopupMenu and it > seems to only need to be a VCLXMenu in case it makes any difference to > use > m_xPopupMenu = dynamic_cast<VCLXMenu*>(xPopupMenu.get()); > instead of > m_xPopupMenu = dynamic_cast<VCLXPopupMenu*>(xPopupMenu.get()); > in PopupMenuControllerBase::setPopupMenu