[PATCH] KAction (Was: [Bug 50342] konsole crash when quitting)

Ellis Whitehead ellis at kde.org
Sun Dec 1 12:15:25 GMT 2002


Hi Waldo,

On Thursday 28 November 2002 17:33, Waldo Bastian wrote:
> On Wednesday 27 November 2002 18:59, Waldo Bastian wrote:
> > The following patch fixes the problem for me. It is not really clear to
> > me why the sequence of events in the bugreport trigger this bug, Maybe
> > there is something else wrong as well?
> >
> > Short description:
> > m_parentCollection is a normal pointer to a KActionCollection and does
> > not become null when the KActionCollect gets deleted. However, the
> > QObject destructor, called as part of the KActionCollection destructor,
> > deletes all child objects (among them KAction objects) and resets
> > parent() before deleting them. So if parent() is null, the KAction object
> > is being deleted as part of the m_parentCollection destructor and
> > m_parentCollection shouldn't be any longer used.
> >
> > Hmm.. what do we have here.... I guess this means there is something else
> > wrong as well, because there is code in ~KActionCollection that resets
> > pAction->m_parentCollection and that fails to work for some reason.
>
> OK, what's wrong is that there can be multiple "unnamed" KAction's and that
> KActionCollection::_take() uses the name to index the dict. With multiple
> KAction's with the same name it can happen that it takes out the wrong one.

Looks good.





More information about the kde-core-devel mailing list