kdevplatform textdocument.cpp

Milian Wolff mail at milianw.de
Wed Feb 29 18:19:43 UTC 2012

On Wednesday 29 February 2012 18:44:20 Milian Wolff wrote:
> On Wednesday 29 February 2012 17:46:42 Milian Wolff wrote:
> > On Tuesday 28 February 2012 23:35:16 Lambert CLARA wrote:
> > > Hello,
> > > 
> > > I noticed when working on my bookmarks patch that since 82cc03546384d,
> > > TextDocument::close() method in shell/textdocument.cpp is not called
> > > anymore when I close a file tab, but only when exitting kdevelop
> > > completely. Was this intended ? i.e. should I find a new place for the
> > > KTextEditor writeSessionConfig part of my patch :) ?
> > 
> > yeah I think I have found out whats going on there and will show a patch
> > soon (on reviewboard)
> scratch that, the whole working set code once again makes it nearly
> impossible to track this down.
> But I have some news: We are really messing up the management of KatePart,
> the document's are *leaked* until one closes KDevelop. Just look for
> yourself:
> open kdevelop
> attach gdb
> set a breakpoint in KateDocument::~KateDocument
> open a file in kdevelop
> close it
> => breakpoint is *not* hit
> close kdevelop
> -> break point is hit
> this is *really* a bad idea. A kate document *must* be closed as soon as
> possible, otherwise will eat up your memory sooner rather than later...

fixed the leak now, so funny that it's really just the deletion in the ctor 
like one would expect...

all these "deleteLater" all over the place make this code really hard to work 
with and apparently also *very* fragile...

I'd seriously welcome a cleanup of this code. I think it's time for me getting 
back at my work of cleaning up the workingset code and moving it into a 
plugin, thereby properly separating it of the core code... oh and did I 
mention unit tests?

Milian Wolff
mail at milianw.de

More information about the KDevelop-devel mailing list