Otherwise subclasses that unconditionally use m_actionCollection will get crashes. Observed in D28789
Details
- Reviewers
dfaure stefanocrocco - Group Reviewers
Frameworks - Commits
- R294:4b3fc2aedd86: Always create actioncollection
Diff Detail
- Repository
- R294 KBookmarks
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Thanks.
(but now konqueror creates another one, so the konqueror patch needs to changed to "if exactly 5.69" only, right?)
src/kbookmarkmenu.cpp | ||
---|---|---|
69 | This resetting of m_actionCollection in the constructor taking an actionCollection still results in issues, as this KBookmarkMenu constructor taking an actionCollection calls the other constructors not taking an actioncollection, but only resets the m_actionCollection afterwards. As a result the addActions() call in the other constructor will operate on an actionCollection object which is then hidden here again. And also the actionCollection passed will not have any actions added. So any code which tries to access actions unconditionally from the actionCollection using the action id, like "add_bookmark", will get a nullptr and then go boom. Like happens for Konsole which got built still using the old constructor taking a actionCollection, see https://bugs.kde.org/show_bug.cgi?id=420820 |