Gideon crashes when opening a file in MDI mode
Simon Hausmann
hausmann at kde.org
Wed May 22 09:01:02 UTC 2002
(CC'ing David. It's about calling setManager( 0 ) in removePart in
the PartManager)
On Tue, May 21, 2002 at 10:37:22PM +0200, Bernd Gehrmann wrote:
> On Tuesday 21 May 2002 12:55, you wrote:
>
> > Looks ... interesting, although I can read only half of the patch.
> > Can you re-send it as unified diff with function names (-u -p) ?
>
> Oops, here it is again ... but on second thought, I don't understand
> what's really the problem and why it doesn't occur in other
> applications.
>
> Anyway, the "part->setManager(0)" part of the patch is certainly right :-)
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 ;-)
Looks like some code duplication is in order :-( . The other option
would be to overload removePart with an additional boolean/enum
argument, toggling the setManager call, while staying binary
compatible. But that looks like more an API uglifiycation :-(
Not sure which way is better. Agreed on the need for calling
setManager( 0 ) in the normal case of someone calling removePart
though.
Simon
More information about the KDevelop-devel
mailing list