Gideon crashes when opening a file in MDI mode
Bernd Gehrmann
Bernd-Gehrmann at gmx.de
Wed May 22 09:47:03 UTC 2002
On Wednesday 22 May 2002 08:59, Simon Hausmann wrote:
> Hm, yes. But it takes more than that. The slot connected to the
> part's destroyed() signal calls removePart() with sender(). If
> removedPart would call setManager, then in that case it would
> call it on a partially dead object, as the destroyed() signal is
> emitted from within the ~Object destructor. I guess it would still
> work given that the object is allocated as one big chunk of memory,
> freed after the last dtor, but that's a hack ;-)
The patch again... someday I'll learn to use KMail ;-)
This calls removePart() from the Part destructor.
While ~Part is executed, the object is still valid. That
means, at this place a method invocation on the part object should
be no problem.
There may still a problem when you do
delete part->widget()
Then it is undefined in which order ~Part and PartManager::widgetDestroyed()
are called.
The use of QGuardedPtr in Part seems to be redundant btw.
Part::slotWidgetDestroyed() already takes care of setting the m_widget
pointer to 0. The only way that this method is not called is when the
widget is destructed by the part itself, in ~Part. But then setting
m_widget to 0 is unnecessary anyway, because the part object is gone
afterwards.
Bernd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: text/x-diff
Size: 1467 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20020522/deba4232/attachment.bin>
More information about the KDevelop-devel
mailing list